.page-wrapper{
    display:flex;
    margin-top:90px;
}


/* ---------- sidebar ---------- */

/* =========================================
   サイドバー
========================================= */

.sidebar {
    width: 280px;
    height: calc(100vh - 90px);

    padding: 32px 20px;

    background: #ffffff;
    border-right: 1px solid #e2e8f0;

    position: sticky;
    top: 90px;

    overflow-y: auto;
    flex-shrink: 0;
}


/* 数学ⅠA */
.sidebar-grade {
    margin: 0 10px 24px;

    color: #1e3a8a;
    font-size: 1.4rem;
    font-weight: 800;
}


/* 分野ごとのまとまり */
.sidebar-category {
    margin-bottom: 8px;
}


/* details標準の三角形を非表示 */
.sidebar-title {
    display: flex;
    justify-content: space-between;
    align-items: center;

    width: 100%;
    padding: 13px 14px;

    color: #334155;
    background: transparent;
    border: none;
    border-radius: 9px;

    font-size: 1rem;
    font-weight: 700;
    text-align: left;

    cursor: pointer;
    list-style: none;

    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}


/* Chrome・Safari用の標準マーカー非表示 */
.sidebar-title::-webkit-details-marker {
    display: none;
}


/* 右側の矢印 */
.sidebar-title::after {
    content: "›";

    color: #2563eb;
    font-size: 1.25rem;

    transform: rotate(90deg);

    transition: transform 0.25s ease;
}


/* 展開中は矢印を上向きにする */
.sidebar-category[open] > .sidebar-title::after {
    transform: rotate(-90deg);
}


/* 見出しにカーソルを載せたとき */
.sidebar-title:hover {
    color: #2563eb;
    background-color: #f8fafc;
}


/* 展開中の分野見出し */
.sidebar-category[open] > .sidebar-title {
    color: #2563eb;
    background-color: #f8fbff;
}


/* 小分野一覧 */
.sidebar-list {
    list-style: none;

    margin: 6px 0 12px;
    padding: 4px 0 4px 14px;

    border-left: 1px solid #dbeafe;
}


/* 小分野の各項目 */
.sidebar-list li {
    margin: 3px 0;
}


/* 小分野リンク */
.sidebar-list a {
    display: block;

    padding: 9px 13px;

    color: #64748b;
    border-radius: 8px;

    font-size: 0.92rem;
    text-decoration: none;

    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}


/* 小分野リンクのホバー */
.sidebar-list a:hover {
    color: #2563eb;
    background-color: #f8fafc;
}


/* 現在表示中のページ */
.sidebar-list li.active {
    padding: 0;
    background: transparent;
}


/*
    既存の.activeではli自体に背景を付けていましたが、
    リンク全体をクリックできるようaに背景を付ける
*/
.sidebar-list li.active > a {
    color: #2563eb;
    background-color: #eff6ff;

    font-weight: 700;
}


/* スクロールバーを細くする */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 999px;
}


/* ---------- main ---------- */

.content-area{
    flex:1;

    padding:50px;

    max-width:900px;
    margin:auto;
}


/* ---------- card ---------- */

.content-card{
    background:white;

    border:1px solid #e2e8f0;

    border-radius:16px;

    padding:35px;

    margin-bottom:30px;

    box-shadow:
        0 4px 12px rgba(0,0,0,0.03);
}

.card-title{
    font-size:2rem;

    color:#1e293b;

    margin-bottom:25px;
}

.card-body{
    color:#475569;

    line-height:2;
}


/* ---------- important ---------- */

.important-card{
    background:#f0f9ff;
}


/* ---------- mistake ---------- */

.mistake-card{
    background:#fff7ed;
}


/* ---------- summary ---------- */

.summary-card{
    background:#f0f9ff;
}


/* ---------- bottom ---------- */

.bottom-navigation{
    display:flex;

    justify-content:space-between;

    margin-top:50px;
}

.move-btn{
    border:none;

    padding:15px 30px;

    border-radius:30px;

    background:#3b82f6;

    color:white;

    cursor:pointer;

    transition:0.2s;
}

.move-btn:hover{
    background:#2563eb;
}

/* =========================================
   問題タイプ選択画面
========================================= */


/* 上部タイトル */
.problem-type-heading {
    margin-bottom: 35px;
}

.problem-type-label {
    margin-bottom: 6px;

    color: #2563eb;

    font-size: 0.9rem;
    font-weight: 700;
}

.problem-type-title {
    margin-bottom: 10px;

    color: #0f172a;

    font-size: 2.3rem;
    font-weight: 800;
}

.problem-type-description {
    color: #64748b;

    font-size: 1rem;
}


/* =========================================
   問題タイプのカード一覧
========================================= */

.problem-type-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 28px;
}


/* 各問題タイプカード */
.problem-type-card {
    min-height: 260px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: flex-start;

    padding: 30px 24px 24px;

    background: #ffffff;

    border: 1px solid #e2e8f0;

    border-radius: 18px;

    box-shadow:
        0 6px 20px rgba(15, 23, 42, 0.04);

    color: inherit;

    font: inherit;

    cursor: pointer;

    text-align: center;

    opacity: 0;

    translate: 0 25px;

    animation:
        problem-type-fade-up
        0.6s
        ease-out
        forwards;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}


/* hover */
.problem-type-card:hover {

    transform: translateY(-5px);

    border-color: #bfdbfe;

    box-shadow:
        0 15px 30px
        rgba(37, 99, 235, 0.10);
}


/* カードアイコン */
.problem-type-icon {

    width: 82px;
    height: 82px;

    margin-bottom: 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #eff6ff;

    border-radius: 50%;
}


.problem-type-icon svg {

    width: 55px;
    height: 55px;

}


/* タイトル */
.problem-type-card h2 {

    margin-bottom: 12px;

    color: #172554;

    font-size: 1.25rem;
}


/* 説明 */
.problem-type-card p {

    margin-bottom: 24px;

    color: #64748b;

    font-size: 0.92rem;

    line-height: 1.7;
}


/* 「解説を見る」 */
.problem-type-link {

    margin-top: auto;

    color: #2563eb;

    font-size: 0.9rem;

    font-weight: 700;
}


/* =========================================
   フェードイン
========================================= */

@keyframes problem-type-fade-up {

    from {

        opacity: 0;

        translate: 0 25px;

    }

    to {

        opacity: 1;

        translate: 0 0;

    }

}


/* 少しずつ時間差表示 */
.problem-type-card:nth-child(1) {
    animation-delay: 0.05s;
}

.problem-type-card:nth-child(2) {
    animation-delay: 0.12s;
}

.problem-type-card:nth-child(3) {
    animation-delay: 0.19s;
}

.problem-type-card:nth-child(4) {
    animation-delay: 0.26s;
}

.problem-type-card:nth-child(5) {
    animation-delay: 0.33s;
}

.problem-type-card:nth-child(6) {
    animation-delay: 0.40s;
}


/* =========================================
   個別解説
========================================= */

.lesson-view {

    animation:
        lesson-fade-in
        0.35s
        ease-out;

}


@keyframes lesson-fade-in {

    from {

        opacity: 0;

        translate: 0 15px;

    }

    to {

        opacity: 1;

        translate: 0 0;

    }

}


/* 問題タイプ一覧へ戻る */
.back-type-button {

    margin-bottom: 28px;

    padding: 0;

    border: none;

    background: none;

    color: #2563eb;

    font-size: 0.95rem;
    font-weight: 600;

    cursor: pointer;

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}


.back-type-button:hover {

    color: #1d4ed8;

    transform: translateX(-3px);

}


/* 解説ページタイトル */
.lesson-heading {

    margin-bottom: 30px;

}

/*==================================
      類似問題
==================================*/

.practice-section{

    margin-top:60px;

}


.practice-title{

    font-size:2rem;

    color:#1e3a8a;

}


.practice-description{

    margin:15px 0 35px;

    color:#64748b;

}


.practice-card{

    background:white;

    border:1px solid #e2e8f0;

    border-radius:18px;

    padding:30px;

    margin-bottom:35px;

    box-shadow:0 5px 15px rgba(0,0,0,.05);

}


.practice-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

}


.practice-level{

    background:#dbeafe;

    color:#2563eb;

    padding:5px 14px;

    border-radius:20px;

    font-size:.9rem;

}


.practice-problem{

    margin:25px 0;

    line-height:2;

}


.practice-buttons{

    display:flex;

    gap:15px;

    flex-wrap:wrap;

}


.practice-btn{

    border:none;

    background:#f1f5f9;

    padding:10px 18px;

    border-radius:30px;

    cursor:pointer;

    transition:.25s;

}


.practice-btn:hover{

    background:#dbeafe;

}


.primary-btn{

    background:#3b82f6;

    color:white;

}


.primary-btn:hover{

    background:#2563eb;

}


.practice-hint,
.practice-answer{

    margin-top:20px;

    padding:20px;

    border-left:4px solid #3b82f6;

    background:#eff6ff;

}

/* KaTeX数式が横幅を超えた場合にスクロール可能にする */
.card-body .katex-display,
.practice-card .katex-display {
    overflow-x: auto;
    overflow-y: hidden;

    padding: 10px 4px;

    text-align: center;
}


/* 数式部分のスクロールバー */
.card-body .katex-display::-webkit-scrollbar,
.practice-card .katex-display::-webkit-scrollbar {
    height: 5px;
}

.card-body .katex-display::-webkit-scrollbar-thumb,
.practice-card .katex-display::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 999px;
}


/* 解説内の小見出し */
.card-body h3 {
    margin: 28px 0 12px;

    color: #1e3a8a;

    font-size: 1.15rem;
}


/* 解説内の段落 */
.card-body p {
    margin-bottom: 16px;
}


/* 解説内のリスト */
.card-body ul,
.card-body ol {
    padding-left: 1.5rem;
}

.card-body li {
    margin-bottom: 10px;
}

/* =========================================
   数直線
========================================= */

.number-line-placeholder {
    margin: 30px 0;
}


.number-line-component {
    position: relative;

    width: 100%;
    max-width: 820px;
    min-height: 300px;

    margin: 20px auto;
    padding: 20px 12px;

    background: #ffffff;

    border: 1px solid #dbeafe;
    border-radius: 16px;

    overflow-x: auto;
}


/* SVG本体 */
.number-line-svg {
    display: block;

    width: 100%;
    min-width: 650px;
    height: auto;
}


/* 各不等式のラベル */
.number-line-row-label {
    position: absolute;
    left: 20px;

    width: 105px;

    color: #1e293b;

    font-size: 0.95rem;
    font-weight: 700;

    text-align: right;
}


/* 共通範囲 */
.number-line-row-label.result-label {
    color: #dc2626;
}


/* 数直線の下地 */
.number-line-axis {
    stroke: #94a3b8;
    stroke-width: 2;
}


/* 解となる範囲 */
.number-line-range {
    stroke-width: 5;
    stroke-linecap: round;
}


/* 目盛り */
.number-line-tick {
    stroke: #64748b;
    stroke-width: 1.5;
}


/* 目盛りの数値 */
.number-line-number {
    fill: #475569;

    font-size: 15px;
    font-family: sans-serif;
}


/* 各範囲から共通範囲への補助線 */
.number-line-connection {
    stroke: #94a3b8;
    stroke-width: 1.7;
    stroke-dasharray: 5 4;
}

/* =========================================
   レスポンシブ
========================================= */

@media (max-width: 1000px) {

    .problem-type-grid {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

    }

}


@media (max-width: 650px) {

    .problem-type-grid {

        grid-template-columns: 1fr;

    }


    .problem-type-title {

        font-size: 1.8rem;

    }


    .problem-type-card {

        min-height: 240px;

    }

}

/* スマートフォン */
@media (max-width: 650px) {
    .number-line-component {
        padding: 15px 5px;
    }

    .number-line-row-label {
        left: 8px;
        width: 95px;

        font-size: 0.85rem;
    }
}