"""
商品知识库 - 60+场景模板（已扩展）
"""
from typing import List, Dict, Optional

class KnowledgeBase:
    """礼物知识库"""

    def __init__(self):
        self.scenarios = self._init_scenarios()

    def _init_scenarios(self) -> Dict:
        """初始化场景数据"""
        return {
            # === 父母生日 ===
            "birthday_mom_practical": {
                "id": "birthday_mom_practical",
                "relation": "妈妈",
                "occasion": "生日",
                "style": "实用型",
                "budget_range": [200, 1000],
                "gifts": [
                    {"name": "扫地机器人", "price": 899, "reason": "解放双手，贴心实用"},
                    {"name": "足浴盆", "price": 299, "reason": "健康养生，关心身体"},
                    {"name": "颈椎按摩仪", "price": 399, "reason": "缓解疲劳，关爱健康"},
                ]
            },
            "birthday_mom_beauty": {
                "id": "birthday_mom_beauty",
                "relation": "妈妈",
                "occasion": "生日",
                "style": "美丽型",
                "budget_range": [300, 1500],
                "gifts": [
                    {"name": "护肤品套装", "price": 699, "reason": "留住美丽"},
                    {"name": "丝巾", "price": 299, "reason": "优雅气质"},
                    {"name": "珍珠项链", "price": 899, "reason": "高贵典雅"},
                ]
            },
            "birthday_dad_tech": {
                "id": "birthday_dad_tech",
                "relation": "爸爸",
                "occasion": "生日",
                "style": "科技型",
                "budget_range": [300, 1500],
                "gifts": [
                    {"name": "智能手表", "price": 899, "reason": "科技感十足"},
                    {"name": "蓝牙耳机", "price": 499, "reason": "方便实用"},
                    {"name": "电动剃须刀", "price": 399, "reason": "日常必备"},
                ]
            },
            "birthday_dad_health": {
                "id": "birthday_dad_health",
                "relation": "爸爸",
                "occasion": "生日",
                "style": "健康型",
                "budget_range": [200, 800],
                "gifts": [
                    {"name": "血压计", "price": 299, "reason": "关爱健康"},
                    {"name": "茶叶礼盒", "price": 399, "reason": "品味生活"},
                    {"name": "按摩椅垫", "price": 599, "reason": "放松身心"},
                ]
            },

            # === 情人节 ===
            "valentine_girlfriend_romantic": {
                "id": "valentine_girlfriend_romantic",
                "relation": "女友",
                "occasion": "情人节",
                "style": "浪漫型",
                "budget_range": [300, 2000],
                "gifts": [
                    {"name": "永生花盒", "price": 299, "reason": "永恒的爱"},
                    {"name": "香水套装", "price": 899, "reason": "气质提升"},
                    {"name": "情侣手链", "price": 599, "reason": "甜蜜见证"},
                ]
            },
            "valentine_girlfriend_surprise": {
                "id": "valentine_girlfriend_surprise",
                "relation": "女友",
                "occasion": "情人节",
                "style": "惊喜型",
                "budget_range": [500, 3000],
                "gifts": [
                    {"name": "钻戒", "price": 2999, "reason": "一生一世"},
                    {"name": "口红套装", "price": 699, "reason": "美丽绽放"},
                    {"name": "拍立得相机", "price": 599, "reason": "记录美好"},
                ]
            },
            "valentine_boyfriend_practical": {
                "id": "valentine_boyfriend_practical",
                "relation": "男友",
                "occasion": "情人节",
                "style": "实用型",
                "budget_range": [200, 1000],
                "gifts": [
                    {"name": "皮带", "price": 399, "reason": "成熟稳重"},
                    {"name": "钱包", "price": 299, "reason": "贴身陪伴"},
                    {"name": "游戏手柄", "price": 399, "reason": "投其所好"},
                ]
            },

            # === 纪念日 ===
            "anniversary_couple_romantic": {
                "id": "anniversary_couple_romantic",
                "relation": "伴侣",
                "occasion": "纪念日",
                "style": "浪漫型",
                "budget_range": [300, 2000],
                "gifts": [
                    {"name": "相册定制", "price": 199, "reason": "珍藏回忆"},
                    {"name": "情侣对戒", "price": 999, "reason": "爱的印记"},
                    {"name": "烛光晚餐券", "price": 599, "reason": "浪漫时光"},
                ]
            },
            "anniversary_wedding_meaningful": {
                "id": "anniversary_wedding_meaningful",
                "relation": "老婆",
                "occasion": "结婚纪念日",
                "style": "意义型",
                "budget_range": [500, 3000],
                "gifts": [
                    {"name": "金银首饰", "price": 1999, "reason": "珍贵纪念"},
                    {"name": "名牌包包", "price": 2999, "reason": "品质生活"},
                    {"name": "旅行套餐", "price": 2999, "reason": "二人世界"},
                ]
            },

            # === 母亲节/父亲节 ===
            "mothersday_health": {
                "id": "mothersday_health",
                "relation": "妈妈",
                "occasion": "母亲节",
                "style": "健康型",
                "budget_range": [200, 1000],
                "gifts": [
                    {"name": "燕窝礼盒", "price": 599, "reason": "滋补养颜"},
                    {"name": "按摩仪", "price": 399, "reason": "放松身心"},
                    {"name": "康乃馨花束", "price": 199, "reason": "温馨祝福"},
                ]
            },
            "fathersday_practical": {
                "id": "fathersday_practical",
                "relation": "爸爸",
                "occasion": "父亲节",
                "style": "实用型",
                "budget_range": [200, 800],
                "gifts": [
                    {"name": "保温杯", "price": 199, "reason": "贴心关怀"},
                    {"name": "烟酒茶具", "price": 499, "reason": "品味生活"},
                    {"name": "运动鞋", "price": 399, "reason": "健康活力"},
                ]
            },

            # === 长辈 ===
            "birthday_grandma_health": {
                "id": "birthday_grandma_health",
                "relation": "奶奶",
                "occasion": "生日",
                "style": "健康型",
                "budget_range": [200, 800],
                "gifts": [
                    {"name": "保健品礼盒", "price": 399, "reason": "健康长寿"},
                    {"name": "保暖衣物", "price": 299, "reason": "温暖关怀"},
                    {"name": "按摩器", "price": 499, "reason": "舒缓疲劳"},
                ]
            },
            "birthday_grandpa_leisure": {
                "id": "birthday_grandpa_leisure",
                "relation": "爷爷",
                "occasion": "生日",
                "style": "休闲型",
                "budget_range": [200, 800],
                "gifts": [
                    {"name": "收音机", "price": 199, "reason": "休闲娱乐"},
                    {"name": "拐杖椅", "price": 299, "reason": "贴心实用"},
                    {"name": "茶叶", "price": 399, "reason": "品茗养生"},
                ]
            },

            # === 朋友 ===
            "birthday_bestie_fun": {
                "id": "birthday_bestie_fun",
                "relation": "闺蜜",
                "occasion": "生日",
                "style": "有趣型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "香薰蜡烛", "price": 99, "reason": "放松氛围"},
                    {"name": "手账本", "price": 79, "reason": "记录生活"},
                    {"name": "口红", "price": 299, "reason": "美丽加持"},
                ]
            },
            "birthday_brother_cool": {
                "id": "birthday_brother_cool",
                "relation": "兄弟",
                "occasion": "生日",
                "style": "酷炫型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "机械键盘", "price": 399, "reason": "游戏利器"},
                    {"name": "运动装备", "price": 299, "reason": "活力满满"},
                    {"name": "酒具套装", "price": 199, "reason": "品酒时光"},
                ]
            },

            # === 孩子 ===
            "birthday_kid_fun": {
                "id": "birthday_kid_fun",
                "relation": "孩子",
                "occasion": "生日",
                "style": "趣味型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "乐高玩具", "price": 299, "reason": "益智有趣"},
                    {"name": "绘本套装", "price": 99, "reason": "阅读启蒙"},
                    {"name": "滑板车", "price": 199, "reason": "户外运动"},
                ]
            },
            "birthday_teen_study": {
                "id": "birthday_teen_study",
                "relation": "学生",
                "occasion": "生日",
                "style": "学习型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "文具礼盒", "price": 99, "reason": "学习加油"},
                    {"name": "书籍套装", "price": 149, "reason": "知识礼物"},
                    {"name": "书包", "price": 199, "reason": "实用贴心"},
                ]
            },

            # === 教师节 ===
            "teachersday_respect": {
                "id": "teachersday_respect",
                "relation": "老师",
                "occasion": "教师节",
                "style": "敬意型",
                "budget_range": [100, 300],
                "gifts": [
                    {"name": "钢笔礼盒", "price": 199, "reason": "师恩难忘"},
                    {"name": "茶叶礼盒", "price": 149, "reason": "清心养性"},
                    {"name": "鲜花花束", "price": 99, "reason": "感恩之心"},
                ]
            },

            # === 春节/中秋 ===
            "springfestival_family": {
                "id": "springfestival_family",
                "relation": "家人",
                "occasion": "春节",
                "style": "传统型",
                "budget_range": [200, 1000],
                "gifts": [
                    {"name": "年货礼盒", "price": 299, "reason": "团圆喜庆"},
                    {"name": "坚果礼盒", "price": 199, "reason": "健康美味"},
                    {"name": "红包礼盒", "price": 99, "reason": "传统祝福"},
                ]
            },
            "midautumn_reunion": {
                "id": "midautumn_reunion",
                "relation": "家人",
                "occasion": "中秋节",
                "style": "团圆型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "月饼礼盒", "price": 199, "reason": "团圆甜蜜"},
                    {"name": "大闸蟹券", "price": 399, "reason": "美味佳肴"},
                    {"name": "水果礼盒", "price": 149, "reason": "健康心意"},
                ]
            },

            # === 乔迁 ===
            "housewarming_practical": {
                "id": "housewarming_practical",
                "relation": "朋友",
                "occasion": "乔迁",
                "style": "实用型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "绿植盆栽", "price": 99, "reason": "生机勃勃"},
                    {"name": "餐具套装", "price": 199, "reason": "乔迁之喜"},
                    {"name": "空气净化器", "price": 399, "reason": "健康居家"},
                ]
            },

            # === 看望 ===
            "visit_patient_care": {
                "id": "visit_patient_care",
                "relation": "病人",
                "occasion": "看望",
                "style": "关怀型",
                "budget_range": [100, 300],
                "gifts": [
                    {"name": "水果篮", "price": 99, "reason": "补充营养"},
                    {"name": "牛奶礼盒", "price": 79, "reason": "健康关怀"},
                    {"name": "保健品", "price": 199, "reason": "早日康复"},
                ]
            },
            "visit_newborn_blessing": {
                "id": "visit_newborn_blessing",
                "relation": "新生儿",
                "occasion": "满月",
                "style": "祝福型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "奶粉礼盒", "price": 299, "reason": "营养成长"},
                    {"name": "婴儿衣物", "price": 149, "reason": "温暖祝福"},
                    {"name": "玩具礼盒", "price": 99, "reason": "快乐童年"},
                ]
            },

            # === 商务 ===
            "business_client_formal": {
                "id": "business_client_formal",
                "relation": "客户",
                "occasion": "商务",
                "style": "正式型",
                "budget_range": [300, 2000],
                "gifts": [
                    {"name": "高档茶叶", "price": 599, "reason": "尊贵品味"},
                    {"name": "红酒礼盒", "price": 899, "reason": "品质之选"},
                    {"name": "办公用品套装", "price": 399, "reason": "实用体面"},
                ]
            },
            "business_colleague_friendly": {
                "id": "business_colleague_friendly",
                "relation": "同事",
                "occasion": "生日",
                "style": "友好型",
                "budget_range": [50, 200],
                "gifts": [
                    {"name": "咖啡礼盒", "price": 99, "reason": "提神醒脑"},
                    {"name": "桌面摆件", "price": 79, "reason": "点缀办公"},
                    {"name": "保温杯", "price": 69, "reason": "贴心实用"},
                ]
            },

            # === 更多生日场景 ===
            "birthday_wife_romantic": {
                "id": "birthday_wife_romantic",
                "relation": "老婆",
                "occasion": "生日",
                "style": "浪漫型",
                "budget_range": [500, 3000],
                "gifts": [
                    {"name": "名牌包包", "price": 1999, "reason": "宠爱有加"},
                    {"name": "珠宝首饰", "price": 2999, "reason": "珍贵心意"},
                    {"name": "护肤品套装", "price": 899, "reason": "青春永驻"},
                ]
            },
            "birthday_husband_practical": {
                "id": "birthday_husband_practical",
                "relation": "老公",
                "occasion": "生日",
                "style": "实用型",
                "budget_range": [300, 1500],
                "gifts": [
                    {"name": "手表", "price": 999, "reason": "时间见证"},
                    {"name": "西装", "price": 1299, "reason": "体面大方"},
                    {"name": "钱包", "price": 399, "reason": "贴心实用"},
                ]
            },
            "birthday_girlfriend_surprise": {
                "id": "birthday_girlfriend_surprise",
                "relation": "女友",
                "occasion": "生日",
                "style": "惊喜型",
                "budget_range": [300, 2000],
                "gifts": [
                    {"name": "限量口红", "price": 399, "reason": "宠爱惊喜"},
                    {"name": "香水", "price": 799, "reason": "气质提升"},
                    {"name": "项链", "price": 1299, "reason": "爱的印记"},
                ]
            },
            "birthday_boyfriend_cool": {
                "id": "birthday_boyfriend_cool",
                "relation": "男友",
                "occasion": "生日",
                "style": "酷炫型",
                "budget_range": [200, 1000],
                "gifts": [
                    {"name": "游戏耳机", "price": 499, "reason": "游戏达人"},
                    {"name": "运动鞋", "price": 699, "reason": "潮流活力"},
                    {"name": "智能手环", "price": 299, "reason": "科技时尚"},
                ]
            },

            # === 更多节日场景 ===
            "christmas_fun": {
                "id": "christmas_fun",
                "relation": "朋友",
                "occasion": "圣诞节",
                "style": "趣味型",
                "budget_range": [50, 300],
                "gifts": [
                    {"name": "圣诞礼盒", "price": 99, "reason": "节日氛围"},
                    {"name": "毛绒玩具", "price": 79, "reason": "可爱温馨"},
                    {"name": "巧克力礼盒", "price": 69, "reason": "甜蜜祝福"},
                ]
            },
            "newyear_wishes": {
                "id": "newyear_wishes",
                "relation": "朋友",
                "occasion": "新年",
                "style": "祝福型",
                "budget_range": [50, 200],
                "gifts": [
                    {"name": "日历本", "price": 49, "reason": "新年新气象"},
                    {"name": "红包礼盒", "price": 39, "reason": "传统祝福"},
                    {"name": "台历", "price": 59, "reason": "规划未来"},
                ]
            },

            # === 特殊场景 ===
            "apology_sincere": {
                "id": "apology_sincere",
                "relation": "伴侣",
                "occasion": "道歉",
                "style": "诚意型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "鲜花花束", "price": 199, "reason": "真诚道歉"},
                    {"name": "巧克力", "price": 99, "reason": "甜蜜和解"},
                    {"name": "手写卡片+礼物", "price": 149, "reason": "心意表达"},
                ]
            },
            "thankyou_grateful": {
                "id": "thankyou_grateful",
                "relation": "朋友",
                "occasion": "感谢",
                "style": "感恩型",
                "budget_range": [50, 300],
                "gifts": [
                    {"name": "感谢卡+小礼物", "price": 59, "reason": "心意表达"},
                    {"name": "咖啡券", "price": 99, "reason": "请喝咖啡"},
                    {"name": "小盆栽", "price": 49, "reason": "绿意感恩"},
                ]
            },
            "confession_romantic": {
                "id": "confession_romantic",
                "relation": "喜欢的人",
                "occasion": "表白",
                "style": "浪漫型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "玫瑰花束", "price": 199, "reason": "爱的表达"},
                    {"name": "手工巧克力", "price": 99, "reason": "甜蜜告白"},
                    {"name": "情书+礼物", "price": 149, "reason": "真挚心意"},
                ]
            },

            # === 更多年龄层 ===
            "birthday_child_educational": {
                "id": "birthday_child_educational",
                "relation": "儿童",
                "occasion": "生日",
                "style": "教育型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "益智玩具", "price": 199, "reason": "开发智力"},
                    {"name": "科普书籍", "price": 99, "reason": "知识启蒙"},
                    {"name": "绘画套装", "price": 149, "reason": "艺术培养"},
                ]
            },
            "birthday_elder_respect": {
                "id": "birthday_elder_respect",
                "relation": "长辈",
                "occasion": "生日",
                "style": "敬意型",
                "budget_range": [200, 800],
                "gifts": [
                    {"name": "寿桃礼盒", "price": 199, "reason": "福寿双全"},
                    {"name": "保健品", "price": 399, "reason": "健康长寿"},
                    {"name": "按摩器具", "price": 499, "reason": "舒缓身心"},
                ]
            },

            # === 更多关系 ===
            "birthday_sister_fun": {
                "id": "birthday_sister_fun",
                "relation": "姐妹",
                "occasion": "生日",
                "style": "趣味型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "美妆礼盒", "price": 299, "reason": "一起变美"},
                    {"name": "闺蜜装", "price": 199, "reason": "姐妹情深"},
                    {"name": "美食券", "price": 149, "reason": "一起享受"},
                ]
            },
            "birthday_brother_cool": {
                "id": "birthday_brother_cool",
                "relation": "兄弟",
                "occasion": "生日",
                "style": "酷炫型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "游戏周边", "price": 199, "reason": "投其所好"},
                    {"name": "运动装备", "price": 299, "reason": "一起运动"},
                    {"name": "酒类礼盒", "price": 199, "reason": "兄弟畅饮"},
                ]
            },

            # === 七夕节 ===
            "qixi_lover_romantic": {
                "id": "qixi_lover_romantic",
                "relation": "女友",
                "occasion": "七夕节",
                "style": "浪漫型",
                "budget_range": [200, 2000],
                "gifts": [
                    {"name": "古风发簪", "price": 199, "reason": "中式浪漫"},
                    {"name": "定制情侣对戒", "price": 999, "reason": "牵手一生"},
                    {"name": "星空投影灯", "price": 299, "reason": "鹊桥相会"},
                    {"name": "汉服礼盒", "price": 599, "reason": "穿越古今"},
                ]
            },
            "qixi_husband_meaningful": {
                "id": "qixi_husband_meaningful",
                "relation": "老公",
                "occasion": "七夕节",
                "style": "心意型",
                "budget_range": [200, 1500],
                "gifts": [
                    {"name": "定制皮带", "price": 399, "reason": "拴住他的心"},
                    {"name": "情侣手表", "price": 999, "reason": "时间见证爱情"},
                    {"name": "手写信+礼物", "price": 299, "reason": "最动人的表白"},
                    {"name": "定制酒具", "price": 499, "reason": "把酒言欢"},
                ]
            },

            # === 毕业季 ===
            "graduation_classmate_memories": {
                "id": "graduation_classmate_memories",
                "relation": "同学",
                "occasion": "毕业",
                "style": "纪念型",
                "budget_range": [50, 300],
                "gifts": [
                    {"name": "班级纪念册", "price": 99, "reason": "珍藏青春"},
                    {"name": "定制文化衫", "price": 79, "reason": "同窗情谊"},
                    {"name": "相框套装", "price": 59, "reason": "定格回忆"},
                    {"name": "友谊手链", "price": 39, "reason": "永不断联"},
                ]
            },
            "graduation_teacher_grateful": {
                "id": "graduation_teacher_grateful",
                "relation": "老师",
                "occasion": "毕业",
                "style": "感恩型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "感谢信+鲜花", "price": 99, "reason": "师恩难忘"},
                    {"name": "定制钢笔", "price": 199, "reason": "桃李满天下"},
                    {"name": "纪念相册", "price": 299, "reason": "珍藏教诲"},
                    {"name": "茶叶礼盒", "price": 199, "reason": "清茶谢师恩"},
                ]
            },
            "graduation_self_celebration": {
                "id": "graduation_self_celebration",
                "relation": "自己",
                "occasion": "毕业",
                "style": "庆祝型",
                "budget_range": [100, 1000],
                "gifts": [
                    {"name": "毕业旅行基金", "price": 500, "reason": "犒劳自己"},
                    {"name": "职业装", "price": 599, "reason": "职场新起点"},
                    {"name": "笔记本电脑", "price": 4999, "reason": "工作利器"},
                    {"name": "摄影写真", "price": 399, "reason": "定格青春"},
                ]
            },

            # === 导师 ===
            "mentor_academic_respect": {
                "id": "mentor_academic_respect",
                "relation": "导师",
                "occasion": "毕业/感谢",
                "style": "敬意型",
                "budget_range": [200, 1000],
                "gifts": [
                    {"name": "学术书籍", "price": 199, "reason": "知识传承"},
                    {"name": "高端钢笔", "price": 399, "reason": "书写未来"},
                    {"name": "茶叶礼盒", "price": 299, "reason": "品茗论道"},
                    {"name": "定制印章", "price": 199, "reason": "学术印记"},
                ]
            },
            "mentor_career_guidance": {
                "id": "mentor_career_guidance",
                "relation": "职场导师",
                "occasion": "感谢",
                "style": "感恩型",
                "budget_range": [200, 800],
                "gifts": [
                    {"name": "商务笔记本", "price": 199, "reason": "记录指导"},
                    {"name": "红酒礼盒", "price": 399, "reason": "品味人生"},
                    {"name": "办公摆件", "price": 299, "reason": "事业有成"},
                    {"name": "感谢信+礼物", "price": 199, "reason": "真挚感激"},
                ]
            },

            # === 岳父母/公婆 ===
            "parents_inlaw_respect": {
                "id": "parents_inlaw_respect",
                "relation": "岳父母/公婆",
                "occasion": "节日/生日",
                "style": "敬意型",
                "budget_range": [300, 1500],
                "gifts": [
                    {"name": "保健品礼盒", "price": 599, "reason": "健康长寿"},
                    {"name": "高档茶叶", "price": 399, "reason": "品味生活"},
                    {"name": "按摩椅垫", "price": 799, "reason": "舒适身心"},
                    {"name": "珠宝首饰", "price": 999, "reason": "孝心之选"},
                ]
            },
            "parents_inlaw_firstvisit": {
                "id": "parents_inlaw_firstvisit",
                "relation": "岳父母/公婆",
                "occasion": "初次见面",
                "style": "正式型",
                "budget_range": [300, 1000],
                "gifts": [
                    {"name": "烟酒礼盒", "price": 599, "reason": "传统礼仪"},
                    {"name": "燕窝礼盒", "price": 499, "reason": "滋补养颜"},
                    {"name": "水果礼篮", "price": 299, "reason": "心意满满"},
                    {"name": "特产礼盒", "price": 399, "reason": "家乡味道"},
                ]
            },

            # === 儿童节 ===
            "childrenday_fun": {
                "id": "childrenday_fun",
                "relation": "孩子",
                "occasion": "儿童节",
                "style": "趣味型",
                "budget_range": [50, 500],
                "gifts": [
                    {"name": "玩具礼盒", "price": 199, "reason": "快乐童年"},
                    {"name": "绘本套装", "price": 99, "reason": "知识启蒙"},
                    {"name": "游乐场门票", "price": 299, "reason": "欢乐时光"},
                    {"name": "儿童自行车", "price": 399, "reason": "成长伙伴"},
                ]
            },
            "childrenday_educational": {
                "id": "childrenday_educational",
                "relation": "孩子",
                "occasion": "儿童节",
                "style": "教育型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "科学实验套装", "price": 199, "reason": "探索世界"},
                    {"name": "编程玩具", "price": 299, "reason": "思维启蒙"},
                    {"name": "地球仪", "price": 99, "reason": "认识世界"},
                    {"name": "绘画套装", "price": 149, "reason": "艺术培养"},
                ]
            },

            # === 端午节 ===
            "dragonboat_tradition": {
                "id": "dragonboat_tradition",
                "relation": "家人",
                "occasion": "端午节",
                "style": "传统型",
                "budget_range": [50, 300],
                "gifts": [
                    {"name": "粽子礼盒", "price": 99, "reason": "传统美味"},
                    {"name": "艾草香囊", "price": 39, "reason": "驱邪祈福"},
                    {"name": "咸鸭蛋礼盒", "price": 59, "reason": "端午佳品"},
                    {"name": "绿豆糕", "price": 49, "reason": "清凉消暑"},
                ]
            },

            # === 重阳节 ===
            "double ninth_elder": {
                "id": "doubleninth_elder",
                "relation": "长辈",
                "occasion": "重阳节",
                "style": "敬老型",
                "budget_range": [200, 800],
                "gifts": [
                    {"name": "菊花茶礼盒", "price": 199, "reason": "清热养身"},
                    {"name": "敬老慰问品", "price": 299, "reason": "孝心表达"},
                    {"name": "保健品套装", "price": 399, "reason": "健康长寿"},
                    {"name": "登山杖", "price": 199, "reason": "重阳登高"},
                ]
            },

            # === 订婚 ===
            "engagement_blessing": {
                "id": "engagement_blessing",
                "relation": "情侣",
                "occasion": "订婚",
                "style": "祝福型",
                "budget_range": [500, 3000],
                "gifts": [
                    {"name": "订婚戒指", "price": 1999, "reason": "定情信物"},
                    {"name": "黄金首饰", "price": 2999, "reason": "珍贵承诺"},
                    {"name": "订婚蛋糕", "price": 599, "reason": "甜蜜祝福"},
                    {"name": "情侣对表", "price": 1499, "reason": "时间见证"},
                ]
            },

            # === 周岁/百天 ===
            "baby_first_birthday": {
                "id": "baby_first_birthday",
                "relation": "孩子",
                "occasion": "周岁",
                "style": "祝福型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "抓周礼盒", "price": 199, "reason": "传统习俗"},
                    {"name": "金锁/银锁", "price": 399, "reason": "平安健康"},
                    {"name": "成长相册", "price": 99, "reason": "记录成长"},
                    {"name": "玩具套装", "price": 149, "reason": "快乐成长"},
                ]
            },
            "baby_hundred_days": {
                "id": "baby_hundred_days",
                "relation": "孩子",
                "occasion": "百天",
                "style": "祝福型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "银手镯", "price": 299, "reason": "平安喜乐"},
                    {"name": "婴儿礼盒", "price": 199, "reason": "温暖祝福"},
                    {"name": "百天蛋糕", "price": 199, "reason": "庆祝成长"},
                    {"name": "婴儿用品套装", "price": 299, "reason": "实用贴心"},
                ]
            },

            # === 预算场景 ===
            "budget_low_meaningful": {
                "id": "budget_low_meaningful",
                "relation": "朋友",
                "occasion": "生日",
                "style": "经济型",
                "budget_range": [30, 100],
                "gifts": [
                    {"name": "手工卡片", "price": 19, "reason": "心意无价"},
                    {"name": "小盆栽", "price": 39, "reason": "绿意祝福"},
                    {"name": "书签套装", "price": 29, "reason": "阅读陪伴"},
                ]
            },
            "budget_high_luxury": {
                "id": "budget_high_luxury",
                "relation": "重要的人",
                "occasion": "特殊日子",
                "style": "奢华型",
                "budget_range": [2000, 10000],
                "gifts": [
                    {"name": "奢侈品包包", "price": 5999, "reason": "品质之选"},
                    {"name": "高级珠宝", "price": 8999, "reason": "珍贵心意"},
                    {"name": "名表", "price": 9999, "reason": "时间见证"},
                ]
            },

            # === 兴趣导向 ===
            "interest_sports": {
                "id": "interest_sports",
                "relation": "运动爱好者",
                "occasion": "生日",
                "style": "运动型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "运动水壶", "price": 79, "reason": "运动必备"},
                    {"name": "运动手环", "price": 199, "reason": "记录运动"},
                    {"name": "运动护具", "price": 99, "reason": "保护安全"},
                ]
            },
            "interest_reading": {
                "id": "interest_reading",
                "relation": "书虫",
                "occasion": "生日",
                "style": "文艺型",
                "budget_range": [50, 200],
                "gifts": [
                    {"name": "畅销书籍", "price": 59, "reason": "精神食粮"},
                    {"name": "书签套装", "price": 39, "reason": "阅读伴侣"},
                    {"name": "阅读灯", "price": 89, "reason": "护眼阅读"},
                ]
            },
            "interest_music": {
                "id": "interest_music",
                "relation": "音乐爱好者",
                "occasion": "生日",
                "style": "音乐型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "蓝牙音箱", "price": 199, "reason": "享受音乐"},
                    {"name": "黑胶唱片", "price": 149, "reason": "复古情怀"},
                    {"name": "耳机", "price": 299, "reason": "沉浸音乐"},
                ]
            },
            "interest_cooking": {
                "id": "interest_cooking",
                "relation": "美食爱好者",
                "occasion": "生日",
                "style": "美食型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "厨具套装", "price": 299, "reason": "烹饪利器"},
                    {"name": "食谱书籍", "price": 59, "reason": "厨艺提升"},
                    {"name": "调料礼盒", "price": 99, "reason": "美味秘诀"},
                ]
            },
            "interest_travel": {
                "id": "interest_travel",
                "relation": "旅行爱好者",
                "occasion": "生日",
                "style": "旅行型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "行李箱", "price": 399, "reason": "说走就走"},
                    {"name": "旅行收纳包", "price": 79, "reason": "整理神器"},
                    {"name": "旅行枕", "price": 59, "reason": "舒适旅途"},
                ]
            },

            # === 更多场景 ===
            "birthday_boss_formal": {
                "id": "birthday_boss_formal",
                "relation": "领导",
                "occasion": "生日",
                "style": "正式型",
                "budget_range": [200, 800],
                "gifts": [
                    {"name": "高档茶具", "price": 599, "reason": "品味雅致"},
                    {"name": "钢笔礼盒", "price": 399, "reason": "实用体面"},
                    {"name": "办公摆件", "price": 299, "reason": "点缀办公"},
                ]
            },
            "birthday_teacher_grateful": {
                "id": "birthday_teacher_grateful",
                "relation": "老师",
                "occasion": "生日",
                "style": "感恩型",
                "budget_range": [100, 300],
                "gifts": [
                    {"name": "保温杯", "price": 99, "reason": "润喉护嗓"},
                    {"name": "书籍", "price": 79, "reason": "知识传递"},
                    {"name": "护手霜", "price": 59, "reason": "粉笔生涯"},
                ]
            },
            "birthday_neighbor_friendly": {
                "id": "birthday_neighbor_friendly",
                "relation": "邻居",
                "occasion": "生日",
                "style": "友好型",
                "budget_range": [50, 200],
                "gifts": [
                    {"name": "水果礼盒", "price": 99, "reason": "邻里和睦"},
                    {"name": "糕点礼盒", "price": 79, "reason": "甜蜜分享"},
                    {"name": "绿植", "price": 59, "reason": "生机盎然"},
                ]
            },
            "retirement_meaningful": {
                "id": "retirement_meaningful",
                "relation": "同事",
                "occasion": "退休",
                "style": "纪念型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "纪念相册", "price": 199, "reason": "珍藏回忆"},
                    {"name": "旅行券", "price": 399, "reason": "享受生活"},
                    {"name": "保健器材", "price": 299, "reason": "健康关怀"},
                ]
            },
            "promotion_congrats": {
                "id": "promotion_congrats",
                "relation": "朋友",
                "occasion": "升职",
                "style": "祝贺型",
                "budget_range": [100, 500],
                "gifts": [
                    {"name": "领带/丝巾", "price": 199, "reason": "更上层楼"},
                    {"name": "红酒", "price": 299, "reason": "庆祝时刻"},
                    {"name": "钢笔", "price": 199, "reason": "书写新篇"},
                ]
            },
            "wedding_blessing": {
                "id": "wedding_blessing",
                "relation": "朋友",
                "occasion": "婚礼",
                "style": "祝福型",
                "budget_range": [200, 1000],
                "gifts": [
                    {"name": "红包", "price": 666, "reason": "传统祝福"},
                    {"name": "家电", "price": 599, "reason": "新婚实用"},
                    {"name": "情侣摆件", "price": 299, "reason": "百年好合"},
                ]
            },
        }

    def get_all_scenarios(self) -> List[Dict]:
        """获取所有场景"""
        return list(self.scenarios.values())

    def get_scenario(self, scenario_id: str) -> Optional[Dict]:
        """根据ID获取场景"""
        return self.scenarios.get(scenario_id)

    def filter_scenarios(
        self,
        relation: Optional[str] = None,
        occasion: Optional[str] = None,
        style: Optional[str] = None,
        budget_min: Optional[int] = None,
        budget_max: Optional[int] = None
    ) -> List[Dict]:
        """筛选场景"""
        results = []

        for scenario in self.scenarios.values():
            # 关系筛选
            if relation and relation not in scenario.get("relation", ""):
                continue

            # 场合筛选
            if occasion and occasion not in scenario.get("occasion", ""):
                continue

            # 风格筛选
            if style and style not in scenario.get("style", ""):
                continue

            # 预算筛选
            budget_range = scenario.get("budget_range", [0, 999999])
            if budget_min and budget_range[1] < budget_min:
                continue
            if budget_max and budget_range[0] > budget_max:
                continue

            results.append(scenario)

        return results

    def get_gifts(self, scenario_id: str) -> List[Dict]:
        """获取场景对应的礼物"""
        scenario = self.get_scenario(scenario_id)
        if scenario:
            return scenario.get("gifts", [])
        return []
