const fs = require('fs');
const path = require('path');

// 读取章节摘要
const summaryPath = path.join(__dirname, 'books/末日重生-开局囤货十亿物资/story/state/chapter_summaries.json');
const summaries = JSON.parse(fs.readFileSync(summaryPath, 'utf8'));

console.log('章节摘要验证:');
console.log(`总行数: ${summaries.rows.length}`);

// 验证第86行（索引86）
if (summaries.rows.length > 86) {
    const row86 = summaries.rows[86];
    console.log('第86行（索引86）内容:');
    console.log(JSON.stringify(row86, null, 2));
    
    // 检查标题
    if (!row86.title || row86.title.trim() === '') {
        console.log('❌ 错误: 第86行标题为空!');
        console.log(`当前标题值: "${row86.title}"`);
    } else {
        console.log('✅ 第86行标题正常:', row86.title);
    }
} else {
    console.log('❌ 错误: 行数不足，没有第86行！');
    console.log(`最大索引: ${summaries.rows.length - 1}`);
}

// 验证所有行的标题
let emptyCount = 0;
summaries.rows.forEach((row, index) => {
    if (!row.title || row.title.trim() === '') {
        emptyCount++;
        console.log(`❌ 行 ${index} (章节 ${row.chapter}) 标题为空`);
    }
});

console.log(`\n空标题统计: ${emptyCount} 行`);
