UPDATE article_templates
SET card_config_json = jsonb_set(
      jsonb_set(
        jsonb_set(
          jsonb_set(
            jsonb_set(
              card_config_json #- '{wizard,derived_inputs}' #- '{wizard,outline,custom_max_length}',
              '{wizard,steps,basic,description}',
              to_jsonb('研究主题、品牌与背景上下文'::text),
              true
            ),
            '{wizard,basic,cards,template_fields}',
            '{"title": "模板字段", "hint": "填写研究主题和深度要求，帮助 AI 控制报告范围。"}'::jsonb,
            true
          ),
          '{wizard,basic,cards,competitors}',
          '{"title": "参考对象", "hint": "可补充相关品牌、机构或竞品，帮助报告更有参照系。"}'::jsonb,
          true
        ),
        '{wizard,outline,custom_placeholder}',
        to_jsonb('补充一个额外结构，例如"行动建议"'::text),
        true
      ),
      '{wizard,outline,sections}',
      '[
        { "key": "summary", "label": "摘要", "default": true },
        { "key": "background", "label": "研究背景", "default": true },
        { "key": "findings", "label": "关键发现", "default": true },
        { "key": "market_view", "label": "市场判断", "default": false },
        { "key": "risks", "label": "风险与挑战", "default": false },
        { "key": "action_items", "label": "行动建议", "default": false },
        { "key": "conclusion", "label": "结论", "default": false }
      ]'::jsonb,
      true
    ),
    updated_at = NOW()
WHERE scope = 'platform'
  AND template_key = 'research_report'
  AND deleted_at IS NULL;
