{{-- 知识点梳理模板 --}}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>知识点梳理</title>
    <link rel="stylesheet" href="/css/katex/katex.min.css">
    @include('pdf.partials.kp-explain-styles')
</head>
<body>
    <div class="page">
        <div class="kp-explain-header">
            <div class="kp-explain-title">知识点梳理</div>
            <div class="kp-explain-subtitle">本章节用于梳理本卷涉及的知识点，帮助学生在做题前完成预习/复盘。</div>
        </div>

        @if(empty($knowledgePoints))
            <div class="kp-empty">暂无知识点数据</div>
        @else
            <div class="kp-list">
                @foreach($knowledgePoints as $index => $kp)
                    <div class="kp-section">
                        <div class="kp-section-head">
                            <div class="kp-section-name">{{ $loop->iteration }}、{{ $kp['kp_name'] ?? ($kp['kp_code'] ?? '未命名知识点') }}</div>
                        </div>
                        <div class="kp-section-body">
                            @if(!empty($kp['explanation']))
                                {!! $kp['explanation'] !!}
                            @endif
                        </div>
                    </div>
                @endforeach
            </div>
        @endif
    </div>
</body>
</html>
