/* ==========================================
   1. 基本レイアウト・全体設定
   ========================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    line-height: 1.6;
    color: #333333;
    background-color: #f1f5f9;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ヘッダー */
header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: #ffffff;
    padding: 40px 20px;
    text-align: center;
    border-radius: 12px;
    margin-bottom: 60px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0;
    font-size: 26pt;
    letter-spacing: 1px;
}

header p {
    margin: 15px 0 0 0;
    font-size: 13pt;
    opacity: 0.9;
}


/* ==========================================
   2. 各学習ブロックの外枠（ステップエリア）
   ========================================== */
.step-section {
    background-color: #ffffff;
    border-radius: 0 15px 15px 15px; /* 左上だけ丸みを無くして見出しと融合 */
    padding: 35px;
    margin-bottom: 65px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    position: relative;
    border: 2px solid #1e3a8a; /* 外枠の線を少し太くして融合感を強調 */
}

/* 外枠の上側と融合するおしゃれな見出し */
.step-title {
    font-size: 16pt;
    color: #ffffff;
    background-color: #1e3a8a;
    margin: 0;
    padding: 0 25px 0 65px;
    position: absolute;
    left: -2px; /* 外枠の左線と重ねる */
    top: -42px; /* 外枠の上側に飛び出させて融合 */
    height: 42px;
    display: flex;
    align-items: center;
    font-weight: bold;
    border-radius: 12px 12px 0 0; /* 上側だけ丸める */
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
}

/* ステップの左側に浮かび上がる数字アイコン */
.step-section:nth-of-type(1) .step-title::before { content: "1"; }
.step-section:nth-of-type(2) .step-title::before { content: "2"; }
.step-section:nth-of-type(3) .step-title::before { content: "3"; }
.step-section:nth-of-type(4) .step-title::before { content: "4"; }
.step-section:nth-of-type(5) .step-title::before { content: "5"; }

.step-title::before {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: #ffffff;
    color: #1e3a8a;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13pt;
    font-weight: 900;
}

.danger-box {
    background-color: #fff1f2;
    border-left: 5px solid #e11d48;
    padding: 20px;
    margin-top: 15px;
    border-radius: 8px;
    color: #9f1239;
}

.rule-list {
    list-style: none;
    padding: 0;
}

.rule-item {
    background-color: #f8fafc;
    margin-bottom: 12px;
    padding: 18px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s;
}

.rule-item:hover {
    transform: translateX(5px);
}

.rule-name {
    font-weight: bold;
    color: #2563eb;
    font-size: 13pt;
    display: block;
    margin-bottom: 5px;
}


/* ==========================================
   3. 演習（①〜③）カード・ディバイダー設定
   ========================================== */
.step-section h3 {
    font-size: 14pt;
    color: #1e3a8a;
    background: #eff6ff;
    padding: 12px 20px;
    border-left: 8px solid #2563eb;
    border-radius: 6px;
    margin-top: 45px;
    margin-bottom: 15px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 最初の演習（演習①）の上部余白を調整 */
.step-section h3:first-of-type {
    margin-top: 10px;
}

/* 演習②・③の直前にドットの区切り線を入れて境界をハッキリさせる */
.step-section h3:not(:first-of-type)::before {
    content: "";
    display: block;
    border-top: 3px dotted #cbd5e1;
    margin-top: -30px;
    margin-bottom: 25px;
    padding-top: 5px;
    width: 100%;
}

/* 演習の補足説明テキスト */
.step-section h3 + div {
    font-size: 11pt;
    color: #475569;
    margin-bottom: 15px;
    padding-left: 5px;
}


/* ==========================================
   4. ワークスペース（演習テーブル・入力欄）
   ========================================== */
.workspace-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 45px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    overflow: hidden;
}

.workspace-table td {
    padding: 20px;
    border: 1px solid #cbd5e1;
    vertical-align: top;
}

.bg-left { 
    background-color: #ffffff; 
}

.bg-right { 
    background-color: #f8fafc; 
}

.pane-title {
    font-weight: bold;
    margin-bottom: 12px;
    color: #64748b;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 5px;
    display: flex;
    align-items: center;
}

.pane-title::before {
    content: "✏️";
    margin-right: 8px;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11pt;
    resize: vertical;
    line-height: 1.7;
    background-color: #ffffff;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.source-box {
    background-color: #eff6ff;
    border: 1px dashed #3b82f6;
    padding: 15px;
    font-size: 10.5pt;
    border-radius: 8px;
    margin-bottom: 15px;
    line-height: 1.5;
}


/* ==========================================
   5. ボタン各種・模範解答エリア
   ========================================== */
.btn {
    background-color: #334155;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 10pt;
    margin-bottom: 15px;
    transition: 0.2s;
}

.btn:hover {
    background-color: #1e293b;
}

.btn-success {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    font-size: 14pt;
    font-weight: bold;
    padding: 15px 35px;
    margin: 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.sample-answer {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 15px;
    font-size: 10.5pt;
    border-radius: 8px;
    color: #166534;
}

/* 演習3のグラフ挿入プレビューエリア */
.graph-area-box {
    width: 100%;
    background-color: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    padding: 15px;
}

.inserted-graph-preview {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}


/* ==========================================
   6. ステップ5（提出者情報・レポート出力）バー設定
   ========================================== */
.submission-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.student-info-inputs {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.student-info-inputs label {
    font-size: 11pt;
    font-weight: bold;
    color: #475569;
}

.student-info-inputs input {
    padding: 10px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    font-size: 11pt;
}

.input-short { 
    width: 65px; 
    text-align: center; 
}

.input-medium { 
    width: 180px; 
}


/* ==========================================
   7. 成果物出力エリア（2段組み学術レポート）
   ========================================== */
.report-output-box {
    background-color: #ffffff;
    border: 2px solid #1e3a8a;
    border-radius: 12px;
    padding: 50px;
    margin-top: 30px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* 本文の2段組み構造 */
.report-two-columns {
    column-count: 2;
    column-gap: 40px;
    column-rule: 1px dashed #cbd5e1;
}

/* 第1章専用：上部の余白をゼロにして提出者情報と密着 */
.report-heading-first {
    font-size: 13pt;
    font-weight: bold;
    color: #1e3a8a;
    border-bottom: 1px solid #94a3b8;
    padding-bottom: 3px;
    margin-top: 0px;
    margin-bottom: 10px;
    display: block;
    break-inside: avoid;
}

/* 通常の章見出し */
.report-heading {
    font-size: 13pt;
    font-weight: bold;
    color: #1e3a8a;
    border-bottom: 1px solid #94a3b8;
    padding-bottom: 3px;
    margin-top: 20px;
    margin-bottom: 10px;
    display: block;
    break-inside: avoid;
}

/* 第3章専用：強制的に右カラムの先頭に送る制御 */
.report-heading-right {
    font-size: 13pt;
    font-weight: bold;
    color: #1e3a8a;
    border-bottom: 1px solid #94a3b8;
    padding-bottom: 3px;
    margin-top: 0px;
    margin-bottom: 10px;
    display: block;
    break-inside: avoid;
    break-before: column;
}

/* 画像表示枠 */
.report-image-container {
    text-align: center;
    margin: 15px 0;
    break-inside: avoid;
}

.report-final-image {
    width: 100%;
    max-width: 320px;
    height: auto;
    border: 1px solid #cbd5e1;
}

/* 中央揃えの図表キャプション */
.report-caption-center {
    text-align: center;
    font-size: 10.5pt;
    font-weight: bold;
    color: #334155;
    margin-top: 5px;
    margin-bottom: 20px;
    break-inside: avoid;
}

/* レポート最下部の参考文献一覧セクション */
.report-sources-section {
    margin-top: 40px;
    border-top: 2px solid #1e3a8a;
    padding-top: 15px;
    clear: both;
}

/* ==========================================
   8. 画面最下部のフッター設定
   ========================================== */
.site-footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid #cbd5e1; /* 上部に薄い区切り線 */
    text-align: center;
}

.site-footer p {
    font-size: 9.5pt;
    color: #64748b; /* 目立ちすぎない落ち着いたグレー */
    margin: 0;
}