/* ============================================================================
   Claude Code 風格導航設計
   ============================================================================ */

/* ============================================================================
   統一導航樣式 - 簡化版本
   ============================================================================ */

/* ============================================================================
   統一導航樣式 - 簡化版本
   ============================================================================ */

/* 基礎設定 */
.md-sidebar--primary .md-sidebar__scrollwrap {
    border-right: 1px solid hsl(0, 0%, 90%);
}

.md-nav--primary {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.md-nav--primary .md-nav__link,
.md-nav--primary .md-nav__container {
    box-shadow: none !important;
}

/* ============================================================================
   右側 Table of Contents 樣式
   ============================================================================ */

/* 1. TOC 容器基礎設定 */
/* ────────────────────────────────────────────────────────────────────────── */

/* TOC 導航整體樣式 */
.md-nav--secondary {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* 2. TOC 標題自定義 */
/* ────────────────────────────────────────────────────────────────────────── */

/* 完全隱藏原始 TOC 標題並替換為自定義內容 */
.md-nav--secondary .md-nav__title {
    font-weight: 600;
    color: hsl(0, 0%, 25%);
    padding: 8px 16px;
    margin: 4px 0;
    position: relative;
    text-indent: -9999px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    box-shadow: unset !important;
}

/* 隱藏所有子元素 */
.md-nav--secondary .md-nav__title * {
    display: none !important;
    visibility: hidden !important;
    box-shadow: unset !important;
}

/* 添加自定義 "On this page" 文字和圖標 */
.md-nav--secondary .md-nav__title::before {
    content: "On this page";
    font-weight: 600;
    font-size: 14px;
    color: hsl(0, 0%, 25%);
    display: block !important;
    position: absolute;
    top: 8px;
    left: 16px;
    padding-left: 20px;
    box-shadow: unset !important;
    text-indent: 0 !important;
    white-space: normal !important;
    background-image: url('data:image/svg+xml;utf8,<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="hsl(0, 0%, 25%)" stroke-width="2" xmlns="http://www.w3.org/2000/svg"><path d="M2.44434 12.6665H13.5554" stroke-linecap="round" stroke-linejoin="round"></path><path d="M2.44434 3.3335H13.5554" stroke-linecap="round" stroke-linejoin="round"></path><path d="M2.44434 8H7.33323" stroke-linecap="round" stroke-linejoin="round"></path></svg>');
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 16px 16px;
}

/* 3. TOC 層級結構 */
/* ────────────────────────────────────────────────────────────────────────── */

/* TOC 一級項目 - 與左側導航風格一致 */
.md-nav--secondary .md-nav__item > .md-nav__link {
    font-weight: 600;
    font-size: 14px;
    padding: 6px 12px;
    color: hsl(0, 0%, 25%);
    margin: 4px 0;
    border-radius: 4px;
    transition: all 150ms ease;
    border: none !important;
    text-decoration: none;
}

/* TOC 二級項目 - 與左側導航風格一致 */
.md-nav--secondary .md-nav .md-nav__item > .md-nav__link {
    font-weight: 400;
    font-size: 14px;
    padding: 6px 12px 6px 24px;
    color: hsl(0, 0%, 40%);
    margin: 4px 0;
    border-radius: 4px;
    transition: all 150ms ease;
}

/* 4. TOC 互動效果 */
/* ────────────────────────────────────────────────────────────────────────── */

/* TOC 懸停效果 */
.md-nav--secondary .md-nav__link:hover {
    background-color: hsl(0, 0%, 98%);
    color: hsl(0, 0%, 10%);
}

/* TOC 當前項目高亮 */
.md-nav--secondary .md-nav__item--active > .md-nav__link {
    background-color: hsl(0, 0%, 92%) !important;
    color: hsl(0, 0%, 10%) !important;
    font-weight: 600 !important;
}

/* TOC 點亮狀態下的 hover 效果 */
.md-nav--secondary .md-nav__item--active > .md-nav__link:hover {
    background-color: hsl(0, 0%, 92%) !important;
    color: hsl(0, 0%, 10%) !important;
}

/* 5. TOC 深色模式適配 */
/* ────────────────────────────────────────────────────────────────────────── */

/* 深色模式 - TOC 標題 */
[data-md-color-scheme="slate"] .md-nav--secondary .md-nav__title {
    color: hsl(0, 0%, 75%);
}

/* 深色模式 - TOC 自定義標題 */
[data-md-color-scheme="slate"] .md-nav--secondary .md-nav__title::before {
    color: hsl(0, 0%, 75%) !important;
    background-image: url('data:image/svg+xml;utf8,<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="hsl(0, 0%, 75%)" stroke-width="2" xmlns="http://www.w3.org/2000/svg"><path d="M2.44434 12.6665H13.5554" stroke-linecap="round" stroke-linejoin="round"></path><path d="M2.44434 3.3335H13.5554" stroke-linecap="round" stroke-linejoin="round"></path><path d="M2.44434 8H7.33323" stroke-linecap="round" stroke-linejoin="round"></path></svg>');
}

/* 深色模式 - TOC 一級項目 */
[data-md-color-scheme="slate"] .md-nav--secondary .md-nav__item > .md-nav__link {
    color: hsl(0, 0%, 75%);
}

/* 深色模式 - TOC 二級項目 */
[data-md-color-scheme="slate"] .md-nav--secondary .md-nav .md-nav__item > .md-nav__link {
    color: hsl(0, 0%, 60%);
}

/* 深色模式 - TOC 懸停效果 */
[data-md-color-scheme="slate"] .md-nav--secondary .md-nav__link:hover {
    background-color: hsl(0, 0%, 18%);
    color: hsl(0, 0%, 90%);
}

/* 深色模式 - TOC 當前項目高亮 */
[data-md-color-scheme="slate"] .md-nav--secondary .md-nav__item--active > .md-nav__link {
    background-color: hsl(0, 0%, 12%) !important;
    color: hsl(0, 0%, 90%) !important;
}

/* 深色模式 - TOC 點亮狀態 hover 效果 */
[data-md-color-scheme="slate"] .md-nav--secondary .md-nav__item--active > .md-nav__link:hover {
    background-color: hsl(0, 0%, 12%) !important;
    color: hsl(0, 0%, 90%) !important;
}
