.site-main{
    display: flex;       
    gap: 20px;           
    align-items: flex-start;
    margin-top:2rem;
}
/* ウィジェット全体の枠組み */
.term-dictionary-widget {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    width: 300px;
}

/* タイトルの装飾（目次・専門用語共通） */
.term-dictionary-widget .widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
}

/* 最初のタイトルだけ上の余白を消す */
.term-dictionary-widget .widget-title:first-child {
    margin-top: 0;
}

/* --- 目次（TOC）セクションのスタイル --- */
.side-toc-list {
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
}

.side-toc-list li {
    /* margin-bottom: 4px; */
    padding:0;
}

.side-toc-list a {
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
    padding:0;
}

/* 親項目（H2相当） */
.toc-parent {
    font-weight: 600;
    border-bottom: 1px solid #f7fafc;
}
.toc-parent a {
    padding: 0;
    color: #4a5568;
}

/* 子項目（H3相当：ツリー構造） */
.toc-child {
    padding-left: 1.2em;
    position: relative;
}

.toc-child a {
    padding-left: 1rem;
    color: #718096;
    font-size: 0.95em;
}

/* --- 専門用語逆引きセクションのスタイル --- */
.side-term-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap; /* ボタンを横に並べる */
    width: 100%;
}

.side-term-list li {
    width: 100%; /* 1列に並べる場合。2列なら 48% */
    padding:0;
}

/* スティッキー追従（最後の子要素として設定） */
.term-dictionary-widget {
    position: -webkit-sticky;
    position: sticky;
    top: 20px;
}


/* -----------------------------------------
   モーダル全体のオーバーレイ（背景）
-------------------------------------------- */
.modal-overlay {
    display: none; /* JSで表示制御 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75); /* 背景をしっかり暗く */
    z-index: 10000; /* ヘッダーなどより上に表示 */
    justify-content: center;
    align-items: center;
    padding: 15px;
    backdrop-filter: blur(5px); /* 背景をぼかして高級感を演出 */
    cursor: pointer; /* 背景をクリックして閉じれることを示唆 */
}

/* -----------------------------------------
   モーダルカード本体
-------------------------------------------- */
.modal-content-card {
    background: #fff;
    width: 100%;
    max-width: 700px; /* 図解が見やすい幅 */
    max-height: 90vh; /* 画面からはみ出さないように */
    border-radius: 12px;
    overflow: hidden; /* 角丸を画像にも適用 */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    cursor: default; /* カード上ではポインタを戻す */
    display: flex;
    flex-direction: column;
    animation: modalBounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* -----------------------------------------
   カードヘッダー（用語タイトルと×ボタン）
-------------------------------------------- */
.modal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #fcfcfc;
    border-bottom: 1px solid #eee;
}

.modal-card-header span:first-child {
    font-weight: 700;
    color: #333;
    font-size: 1.1rem;
    border-left: 4px solid #3498db; /* アクセントカラー（サイトに合わせて変更可） */
    padding-left: 10px;
}

.close-x {
    font-size: 32px;
    font-weight: 300;
    color: #aaa;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    padding: 5px;
}

.close-x:hover {
    color: #cf2e2e;
    transform: rotate(90deg); /* ホバー時に回転させる遊び心 */
}

/* -----------------------------------------
   カードボディ（画像表示エリア）
-------------------------------------------- */
.modal-card-body {
    overflow-y: auto; /* 画像が縦に長い場合スクロール可能に */
    background: #fff;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-card-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

/* -----------------------------------------
   アニメーション
-------------------------------------------- */
@keyframes modalBounceIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* -----------------------------------------
   スマホ対応（モバイル表示の最適化）
-------------------------------------------- */
@media screen and (max-width: 1000px) {
    .modal-content-card {
        max-width: 100%;
        border-radius: 8px;
    }
    .modal-card-header {
        padding: 12px 15px;
    }

    .term-dictionary-widget{
        display: none;
    }
}