@charset "UTF-8";

/* Lightningテーマのヘッダー・フッター・タイトルを非表示にする（パンくずは残す） */
header.site-header, footer.site-footer, .siteHeader, .siteFooter, .site-footer-copyright,
.page-header, .entry-header, .site-header-sub {
    display: none !important;
}

/* パンくずリスト下の無駄な余白を完全に消去する超強力な指定 */
body > .site-body, 
body > .siteContent, 
.site-body-container, 
.main-section {
    padding-top: 0 !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
    max-width: 100% !important; /* テーマの幅制限を解除 */
}

/* コンテンツの内側余白もすべて殺す */
.site-content, .section, .container, .entry-body, .entry-content {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
}

body {
    background-color: #eef7ee !important;
}

/* =========================================
   1. CBTシステム全体のコンテナ
========================================= */
#boki-cbt-container {
    width: 95vw !important; /* 画面幅の95%を確保 */
    max-width: 1200px !important;
    /* ★修正: 左右のマージンを強制的にautoにして中央揃え。親要素の影響を受けないようdisplayを指定 */
    display: block !important; 
    margin: 10px auto 100px auto !important; 
    padding: 0 !important;
    position: relative;
    text-align: left !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* ヘッダー部分（タイマーなど） */
#boki-cbt-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #2c3e50;
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    font-size: 1.1em;
    font-weight: bold;
}

/* =========================================
   2. 問題文・ワークスペース領域
========================================= */
#boki-cbt-workspace {
    padding: 30px;
    min-height: 400px;
}

#boki-cbt-workspace h3 {
    margin-top: 0;
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 10px;
    font-size: 1.5em;
}

/* ★追加: 問題文（クラシックエディタ）内に配置されたテーブルの自動デザイン */
.boki-question-content table {
    border-collapse: collapse;
    margin-bottom: 20px;
    width: auto; /* 基本は文字幅に合わせる */
}
/* 手動で幅を指定したい場合の補助クラス */
table.boki-table-full { width: 100% !important; }
table.boki-table-fixed { table-layout: fixed; }

.boki-question-content th, .boki-question-content td {
    border: 1px solid #777777;
    padding: 2px 8px;
    text-align: center;
}
/* ---------------------------------------------------- */

/* 問題本文の表示エリア */
.boki-question-content {
    margin-bottom: 20px;
    line-height: 1.6;
}

/* =========================================
   3. 簿記特有のテーブル（解答用紙）レイアウト
========================================= */
/* Lightningテーマの余白を強制上書きしてコンパクトに */
.boki-cbt-table {
    width: auto !important; /* ★変更: 100%引き伸ばしをオフにし、設定した幅を反映させる */
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #ffffff;
    border: none !important; /* ★追加: 表の周りの薄い囲み罫線を完全に削除 */
}

/* Lightningテーマの余白を強制上書きしてコンパクトに（高さを27pxに固定） */
.boki-cbt-table td, 
.boki-cbt-table th {
    border: 1px solid #aaaaaa !important;
    padding: 1px 4px !important;
    vertical-align: middle;
    /* ★変更: height: 27px !important; を削除し、エディタで設定した高さを最優先させる */
    line-height: 1.2 !important;
}

/* 金額入力欄（セルの高さに合わせて自動で伸びるように） */
/* 入力欄はセルの中にピッタリ収まるように微調整（高さは25px固定） */
.boki-amount-input {
    width: 100%; box-sizing: border-box; margin: 0 auto !important;
    padding: 0 4px !important; 
    font-size: 14px !important; /* ★変更: 文字サイズを他のものと同じ14pxで固定 */
    height: 25px !important; 
    max-height: 25px !important;
    text-align: right; border: 1px solid #999999; background-color: #faffbd !important;
    display: block; 
}
.boki-amount-input:focus { background-color: #ffffff !important; outline: 2px solid #3498db; }

/* =========================================
   4. 新しい罫線システム（個別枠・斜線）
========================================= */
/* 簿記特有・新しい罫線スタイル（テーマに負けないよう td 指定を追加して優先度UP） */
.boki-cbt-table td.boki-border-none { border: none !important; background: transparent; }
.boki-cbt-table td.boki-border-all { border: 1px solid #333333 !important; }
.boki-cbt-table td.boki-border-top { border-top: 1px solid #333333 !important; border-bottom: none !important; border-left: none !important; border-right: none !important; }
.boki-cbt-table td.boki-border-bottom { border-bottom: 1px solid #333333 !important; border-top: none !important; border-left: none !important; border-right: none !important; }
.boki-cbt-table td.boki-border-left { border-left: 1px solid #333333 !important; border-top: none !important; border-bottom: none !important; border-right: none !important; }
.boki-cbt-table td.boki-border-right { border-right: 1px solid #333333 !important; border-top: none !important; border-bottom: none !important; border-left: none !important; }
.boki-cbt-table td.boki-border-bottom-double { border-bottom: 3px double #333333 !important; border-top: none !important; border-left: none !important; border-right: none !important; }

/* ★追加: 点線の定義 */
.boki-cbt-table td.boki-border-top-dotted { border-top: 1px dotted #333333 !important; border-bottom: none !important; border-left: none !important; border-right: none !important; }
.boki-cbt-table td.boki-border-bottom-dotted { border-bottom: 1px dotted #333333 !important; border-top: none !important; border-left: none !important; border-right: none !important; }
.boki-cbt-table td.boki-border-left-dotted { border-left: 1px dotted #333333 !important; border-top: none !important; border-bottom: none !important; border-right: none !important; }
.boki-cbt-table td.boki-border-right-dotted { border-right: 1px dotted #333333 !important; border-top: none !important; border-bottom: none !important; border-left: none !important; }

/* 波線（省略線）の定義（SVG背景画像を利用して波線を描画） */
/* ★修正: 管理画面プレビュー（#boki-admin-preview）内でも確実に効くようにセレクタを強化 */
.boki-cbt-table td.boki-border-top-wavy, #boki-admin-preview td.boki-border-top-wavy, .boki-border-top-wavy {
    border: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4'%3E%3Cpath d='M0,2 Q2,0 4,2 T8,2' fill='none' stroke='%23555555' stroke-width='1.5'/%3E%3C/svg%3E") !important;
    background-repeat: repeat-x !important;
    background-position: top left !important;
    background-size: 8px 4px !important;
}
.boki-cbt-table td.boki-border-bottom-wavy, #boki-admin-preview td.boki-border-bottom-wavy, .boki-border-bottom-wavy {
    border: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4'%3E%3Cpath d='M0,2 Q2,0 4,2 T8,2' fill='none' stroke='%23555555' stroke-width='1.5'/%3E%3C/svg%3E") !important;
    background-repeat: repeat-x !important;
    background-position: bottom left !important;
    background-size: 8px 4px !important;
}
.boki-cbt-table td.boki-border-left-wavy, #boki-admin-preview td.boki-border-left-wavy, .boki-border-left-wavy {
    border: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='8'%3E%3Cpath d='M2,0 Q4,2 2,4 T2,8' fill='none' stroke='%23555555' stroke-width='1.5'/%3E%3C/svg%3E") !important;
    background-repeat: repeat-y !important;
    background-position: top left !important;
    background-size: 4px 8px !important;
}
.boki-cbt-table td.boki-border-right-wavy, #boki-admin-preview td.boki-border-right-wavy, .boki-border-right-wavy {
    border: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='8'%3E%3Cpath d='M2,0 Q0,2 2,4 T2,8' fill='none' stroke='%23555555' stroke-width='1.5'/%3E%3C/svg%3E") !important;
    background-repeat: repeat-y !important;
    background-position: top right !important;
    background-size: 4px 8px !important;
}

/* ★追加: 問題文中の表の幅を100%に強制する補助クラス */
table.boki-table-full {
    width: 100% !important;
}

/* 斜線（／）と（＼） */
.boki-cbt-table td.boki-slash-right { 
    background-image: linear-gradient(to top right, transparent calc(50% - 1px), #777777 50%, transparent calc(50% + 1px)) !important; 
    border: none !important; 
}
.boki-cbt-table td.boki-slash-left { 
    background-image: linear-gradient(to bottom right, transparent calc(50% - 1px), #777777 50%, transparent calc(50% + 1px)) !important; 
    border: none !important; 
}

/* =========================================
   5. ナビゲーション（画面下部のボタン類）
========================================= */
#boki-cbt-navigation {
    background-color: #eeeeee;
    border-top: 1px solid #cccccc;
    padding: 15px 20px;
    display: flex;
    gap: 10px;
}

.boki-nav-btn {
    background-color: #ffffff;
    border: 1px solid #aaaaaa;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
    transition: 0.2s;
}

.boki-nav-btn:hover {
    background-color: #e0e0e0;
}

/* =========================================
   6. 追加レイアウト（右配置・2カラム）
========================================= */
/* 解答欄の右側配置用CSS */
.boki-layout-right {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: flex-start;
}
.boki-layout-right .boki-question-content {
    flex: 1;
    min-width: 300px;
}
.boki-layout-right .boki-table-wrapper {
    flex: 1;
    min-width: 300px;
    overflow-x: auto;
}

/* ★問題文（クラシックエディタ）内で使える2カラム補助CSS */
.boki-split-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
}
.boki-split-left {
    flex: 1;
    min-width: 200px;
}
.boki-split-right {
    flex: 1;
    min-width: 200px;
}

/* ★追加：クラシックエディタ利用時の段落（pタグ）の無駄な余白を消去 */
.boki-question-content p, 
#boki-explanation-content p {
    margin: 0 0 5px 0 !important;
    line-height: 1.6;
}

/* 選択中のナビゲーションボタン */
.boki-nav-active {
    background-color: #3498db !important;
    color: #ffffff !important;
    border-color: #2980b9 !important;
}

/* =========================================
   7. 下部固定（フローティング）ナビゲーション
========================================= */
#boki-cbt-navigation {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background-color: #1a252f !important;
    padding: 10px 20px !important;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5) !important;
    z-index: 999999 !important;
    display: none; /* 初期状態は非表示、JSで display:flex; に書き換える */
    align-items: center !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

#boki-nav-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#boki-cbt-navigation .boki-nav-btn {
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #cccccc;
    padding: 8px 16px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 2px;
    cursor: pointer;
}

/* アクティブなタブ（大問）の色 */
#boki-cbt-navigation .boki-nav-active {
    background-color: #e74c3c !important; /* 画像に合わせた赤系 */
    color: #ffffff !important;
    border-color: #c0392b !important;
}

/* 右側の終了ボタン */
#boki-submit-btn {
    margin-left: auto;
    background-color: #ecf0f1 !important;
    color: #333333 !important;
    border: 2px solid #bdc3c7 !important;
}

/* 下部メニュー内のタイマー表示（ヘッダーから移動させるための準備） */
.boki-floating-timer {
    color: #ffffff;
    font-size: 1.2em;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
/* =========================================
   8. 採点結果モーダル（ポップアップ）
========================================= */
#boki-result-screen {
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    background: rgba(0,0,0,0.7) !important;
    z-index: 2147483647 !important; /* 最前面 */
    display: none; /* JSでflexに変更 */
    align-items: center !important; /* 縦方向の中央 */
    justify-content: center !important; /* 横方向の中央 */
    margin: 0 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

/* モーダルの中の白いボックス */
#boki-result-screen > div {
    background: #fff;
    border: 4px solid #27ae60;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    width: 100%;
    max-width: 600px;
    text-align: center;
    position: relative; /* fixedではなくrelativeにして枠内に収める */
    max-height: 90vh; /* 画面からはみ出さないように */
    overflow-y: auto; /* 長い場合はスクロール */
}