/*!
 * Neutrope Quiz Engine Pro - Review Sheet styles (v0.1.0)
 *
 * A4縦印刷を前提にした「自分専用復習シート」のスタイル。
 * - 外部フォント・外部CSS・PDFライブラリ不使用（本CSSはページにインライン埋め込み）。
 * - 白背景／黒・グレー中心／アクセントは濃紺（--nqep-navy）。
 * - 色に依存せず ✓ / ✗ / 枠線 / ラベルで意味が伝わる（白黒印刷対応）。
 * - 命名は Pro 専用 .nqep-* プレフィックス。無料版 .skl-quiz__* には触れない。
 */

:root {
    --nqep-ink: #1a1a1a;
    --nqep-gray: #555;
    --nqep-muted: #777;
    --nqep-line: #c9c9c9;
    --nqep-line-soft: #e4e4e4;
    --nqep-navy: #1f2d5a;
    --nqep-navy-tint: #eef1f8;
    --nqep-paper: #ffffff;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

.nqep-body {
    background: #f3f4f6;
    color: var(--nqep-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
    font-size: 13px;
    line-height: 1.7;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* ============================================================
 * 操作バー（印刷時は非表示）
 * ============================================================ */
.nqep-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 10px;
    background: #fff;
    border-bottom: 1px solid var(--nqep-line);
}

.nqep-toolbar__btn {
    font: inherit;
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    border: 1px solid var(--nqep-navy);
    background: #fff;
    color: var(--nqep-navy);
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none; /* 「戻る」は <a> なので下線を消してボタン見た目に揃える */
    line-height: 1.4;
}

.nqep-toolbar__btn--primary {
    background: var(--nqep-navy);
    color: #fff;
}

.nqep-toolbar__btn--secondary {
    background: #fff;
    color: var(--nqep-navy);
}

/* ============================================================
 * シート本体（画面では1枚の用紙に見せる）
 * ============================================================ */
.nqep-sheet {
    width: 210mm;
    max-width: 100%;
    margin: 16px auto;
    padding: 16mm 15mm;
    background: var(--nqep-paper);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.15);
}

/* ヘッダ */
.nqep-sheet__header {
    border-bottom: 3px solid var(--nqep-navy);
    padding-bottom: 12px;
    margin-bottom: 18px;
}

.nqep-sheet__brand {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--nqep-navy);
    border: 1px solid var(--nqep-navy);
    padding: 2px 10px;
    border-radius: 2px;
    margin: 0 0 8px;
}

.nqep-sheet__title {
    font-size: 22px;
    margin: 0 0 4px;
    color: var(--nqep-ink);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.nqep-sheet__date {
    font-size: 12px;
    color: var(--nqep-muted);
    margin: 0;
}

/* ============================================================
 * スコア
 * ============================================================ */
.nqep-score__main {
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
}

.nqep-score__value {
    font-size: 34px;
    font-weight: 700;
}

.nqep-score__pct {
    font-size: 20px;
    font-weight: 700;
    color: var(--nqep-navy);
}

.nqep-verdict {
    display: inline-block;
    margin: 10px 0;
    padding: 4px 16px;
    border: 2px solid var(--nqep-ink);
    border-radius: 3px;
    font-weight: 700;
}

.nqep-verdict--pass { border-color: var(--nqep-navy); color: var(--nqep-navy); }
.nqep-verdict--fail { border-color: var(--nqep-ink); color: var(--nqep-ink); }
.nqep-verdict--none { border-color: var(--nqep-muted); color: var(--nqep-muted); }

.nqep-verdict--pass::before { content: "\2713  "; }
.nqep-verdict--fail::before { content: "\2717  "; }

.nqep-score__meta {
    display: flex;
    gap: 28px;
    margin: 12px 0 0;
    padding: 0;
    flex-wrap: wrap;
}

.nqep-score__meta dt {
    font-size: 11px;
    color: var(--nqep-muted);
    margin: 0;
}

.nqep-score__meta dd {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

/* ============================================================
 * 分野別正答率（白黒でも棒＋数値で意味が出る）
 * ============================================================ */
.nqep-section-title {
    font-size: 15px;
    border-left: 5px solid var(--nqep-navy);
    padding-left: 10px;
    margin: 24px 0 12px;
}

.nqep-field-list { list-style: none; margin: 0; padding: 0; }

.nqep-field { margin: 0 0 10px; break-inside: avoid; }

.nqep-field__head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    margin-bottom: 3px;
}

.nqep-field__name { font-weight: 600; overflow-wrap: anywhere; }
.nqep-field__score { color: var(--nqep-gray); white-space: nowrap; }

.nqep-field__bar {
    height: 10px;
    border: 1px solid var(--nqep-navy);
    border-radius: 5px;
    background: #fff;
    overflow: hidden;
}

.nqep-field__fill {
    height: 100%;
    background: var(--nqep-navy);
}

/* ============================================================
 * 間違えた問題（2ページ目以降）
 * ============================================================ */
.nqep-wrong {
    break-before: page;
    page-break-before: always;
}

.nqep-card {
    border: 1px solid var(--nqep-line);
    border-radius: 5px;
    padding: 12px 14px;
    margin: 0 0 12px;
    break-inside: avoid;
    page-break-inside: avoid;
}

.nqep-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--nqep-line-soft);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.nqep-card__num {
    font-weight: 700;
    font-size: 14px;
    color: var(--nqep-navy);
}

.nqep-card__badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.nqep-badge {
    font-size: 10px;
    padding: 2px 8px;
    border: 1px solid var(--nqep-line);
    border-radius: 10px;
    color: var(--nqep-gray);
    white-space: nowrap;
}

.nqep-badge--wrong { border-color: var(--nqep-ink); color: var(--nqep-ink); font-weight: 700; }
.nqep-badge--unanswered { border-style: dashed; border-color: var(--nqep-ink); color: var(--nqep-ink); font-weight: 700; }
.nqep-badge--difficulty { border-color: var(--nqep-navy); color: var(--nqep-navy); }

.nqep-card__question {
    font-weight: 600;
    margin: 0 0 10px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* 選択肢 */
.nqep-choices {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
}

.nqep-choice {
    display: flex;
    gap: 6px;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 3px;
    overflow-wrap: anywhere;
}

.nqep-choice__mark {
    flex: 0 0 1.3em;
    width: 1.3em;
    text-align: center;
    font-weight: 700;
}

.nqep-choice__num { color: var(--nqep-muted); }

.nqep-choice--correct {
    border-color: var(--nqep-navy);
    background: var(--nqep-navy-tint);
}
.nqep-choice--correct .nqep-choice__mark::before { content: "\2713"; color: var(--nqep-navy); }

.nqep-choice--wrong {
    border-color: var(--nqep-ink);
    border-style: dashed;
}
.nqep-choice--wrong .nqep-choice__mark::before { content: "\2717"; color: var(--nqep-ink); }

/* あなたの回答 / 正解（コンパクト行） */
.nqep-ansline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    font-size: 12px;
    margin: 0 0 8px;
    overflow-wrap: anywhere;
}

.nqep-ansline strong { color: var(--nqep-ink); font-weight: 700; }
.nqep-ansline--unanswered { color: var(--nqep-muted); }

/* 解説 */
.nqep-explanation {
    background: #fafafa;
    border: 1px solid var(--nqep-line-soft);
    border-radius: 4px;
    padding: 8px 10px;
    margin: 0 0 8px;
    overflow-wrap: anywhere;
}

.nqep-explanation__label {
    font-size: 11px;
    color: var(--nqep-muted);
    font-weight: 700;
    letter-spacing: 0.05em;
    margin: 0 0 4px;
}

.nqep-explanation__body { margin: 0; }
.nqep-explanation__body p { margin: 0 0 6px; }

/* 覚えるポイント（濃紺の左罫＋淡色背景。白黒でも罫で識別可能） */
.nqep-keypoint {
    border-left: 4px solid var(--nqep-navy);
    background: var(--nqep-navy-tint);
    padding: 8px 12px;
    border-radius: 0 4px 4px 0;
    break-inside: avoid;
}

.nqep-keypoint__label {
    font-size: 11px;
    color: var(--nqep-navy);
    font-weight: 700;
    margin: 0 0 2px;
}

.nqep-keypoint__text { margin: 0; overflow-wrap: anywhere; }

/* ============================================================
 * 復習チェックリスト（最後）
 * ============================================================ */
.nqep-checklist { break-inside: avoid; margin-top: 8px; }

.nqep-checklist__hint {
    font-size: 12px;
    color: var(--nqep-muted);
    margin: 0 0 10px;
}

.nqep-checklist__list { list-style: none; margin: 0; padding: 0; }

.nqep-checklist__item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 7px 0;
    border-bottom: 1px dashed var(--nqep-line);
    break-inside: avoid;
}

.nqep-checkbox {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    border: 2px solid var(--nqep-navy);
    border-radius: 3px;
    margin-top: 2px;
}

.nqep-checklist__q { overflow-wrap: anywhere; word-break: break-word; }

/* 空状態 */
.nqep-empty {
    text-align: center;
    color: var(--nqep-muted);
    padding: 24px;
    border: 1px dashed var(--nqep-line);
    border-radius: 6px;
}

/* 見出しは直後の内容と一緒に保つ */
.nqep-sheet h1,
.nqep-sheet h2 {
    break-after: avoid;
    page-break-after: avoid;
}

/* ============================================================
 * 結果画面の CTA（クイズ結果ページに注入される導線）
 *   ボタン自体は無料版 .skl-quiz__btn を流用。ここは並びと誘導文のみ。
 * ============================================================ */
.nqep-cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    align-items: center;
    width: 100%;
    margin-top: 6px;
    text-align: center;
}
.nqep-cta__hint,
.nqep-cta__status {
    flex-basis: 100%;
    margin: 4px 0 0;
    font-size: .85em;
    color: var(--nqep-muted);
}
.nqep-cta__status { font-size: .8em; }
.nqep-cta__login { color: var(--nqep-navy); }

/* ============================================================
 * 印刷（A4縦）
 * ============================================================ */
@page {
    size: A4 portrait;
    margin: 14mm;
}

@media print {
    .nqep-body {
        background: #fff;
        font-size: 10.5pt;
    }

    .nqep-no-print { display: none !important; }

    .nqep-sheet {
        width: auto;
        max-width: none;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }

    .nqep-card { box-shadow: none; }
}
