/* 目次ウィジェットの修正スタイル */
.widget-toc {
    background: white;
    border-radius: 16px;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    /* 位置関連プロパティ削除 */
    position: static !important;
    top: auto !important;
    z-index: auto !important;
}

/* 目次コンテナ修正 - スクロールバー問題解決 */
#table-of-contents {
    max-height: none !important; /* 高さ制限を削除 */
    overflow: visible !important; /* スクロール不要に */
}

/* 目次リスト */
#table-of-contents ul {
    list-style: none;
    padding: 0;
    margin: 0;
    /* スクロールバー削除 */
    overflow: visible !important;
    max-width: 100% !important;
}

#table-of-contents li {
    margin-bottom: 10px;
    line-height: 1.4;
}

/* 目次リンク */
#table-of-contents a {
    display: block;
    padding: 5px 8px;
    color: var(--color-text);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 14px;
    /* 折り返し設定 */
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-all;
    hyphens: auto;
}

#table-of-contents a:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-primary);
    transform: translateX(3px);
}

/* 見出しレベルに応じたスタイル */
#table-of-contents .toc-h2 {
    font-weight: 600;
}

#table-of-contents .toc-h3 {
    padding-left: 15px;
    font-size: 13px;
}

#table-of-contents .toc-h4 {
    padding-left: 25px;
    font-size: 12px;
    color: var(--color-text-light);
}