-- 修复章节 order_index 为 999 的问题
-- 原因：STAGE_KEYWORDS 使用简化阶段名（career, belief），
--       但 CHAPTER_ORDER 使用详细分类名（career_early, beliefs），导致查找失败回退到 999

-- 根据 category 字段修复 order_index
UPDATE chapters SET order_index = 0 WHERE order_index = 999 AND category = 'childhood';
UPDATE chapters SET order_index = 1 WHERE order_index = 999 AND category = 'education';
UPDATE chapters SET order_index = 2 WHERE order_index = 999 AND category = 'career';
UPDATE chapters SET order_index = 2 WHERE order_index = 999 AND category = 'career_early';
UPDATE chapters SET order_index = 3 WHERE order_index = 999 AND category = 'career_achievement';
UPDATE chapters SET order_index = 4 WHERE order_index = 999 AND category = 'career_challenge';
UPDATE chapters SET order_index = 5 WHERE order_index = 999 AND category = 'family';
UPDATE chapters SET order_index = 6 WHERE order_index = 999 AND category = 'belief';
UPDATE chapters SET order_index = 6 WHERE order_index = 999 AND category = 'beliefs';
UPDATE chapters SET order_index = 7 WHERE order_index = 999 AND category = 'summary';
