/*
 * 文件瀏覽器 UI 樣式 - v2.0
 * 遵循 ui-design-spec.md v2.0 中的規範
 */

/* --- 大綱側邊欄 --- */
#desktop-page-outline a,
#mobile-page-outline a {
    display: block;
    padding: 0.5rem 0.5rem;
    border-left: 2px solid transparent;
    transition: all 0.15s ease-in-out;
    font-size: 0.875rem;
    color: rgb(210, 210, 210);
    line-height: 1.4;
    word-break: break-all;
}

#desktop-page-outline a:hover,
#mobile-page-outline a:hover {
    color: var(--text-link-hover);
    background-color: var(--bg-hover);
}

/* 當前啟動的大綱連結 */
#desktop-page-outline a.active,
#mobile-page-outline a.active {
    color: var(--text-link);
    border-left-color: var(--border-active);
    font-weight: 600;
}

/* H2 標題的樣式 */
#desktop-page-outline a.heading-2,
#mobile-page-outline a.heading-2 {
    font-weight: 600;
    color: rgb(210, 210, 210);
    margin-top: 0.5rem;
}

/* H3 及以下標題的縮排 */
#desktop-page-outline a.heading-3,
#mobile-page-outline a.heading-3 {
    padding-left: 1.25rem; /* pl-5 */
}

#desktop-page-outline a.heading-4,
#mobile-page-outline a.heading-4 {
    padding-left: 2rem; /* pl-8 */
}

/* --- 回到頁首按鈕 --- */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--bg-accent);
    color: var(--text-primary);
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, background-color 0.3s;
    z-index: 50;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

#back-to-top:hover {
    background-color: var(--bg-hover);
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* --- PDF iframe --- */
#pdf-viewer iframe {
    width: 100%;
    height: 100%;
    min-height: 90vh; /* 確保有足夠的檢視高度 */
}