body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    background-color: #fff;
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #1a1a1a;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* 新增：下拉選單 ê 樣式 */
.pdf-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.pdf-selector label {
    font-weight: 500;
}

.pdf-selector select {
    font-size: 1em;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 250px;
}

/* 【已刪除】舊 ê .controls 相關樣式攏提掉矣 */

#audio-player {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #fff;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

#pdf-viewer {
    margin-top: 20px;
    border: 1px solid #ddd;
    background-color: #fafafa;
    height: 90vh; /* 設定固定懸度，予伊變成會當絞動 ê 區塊 */
    overflow-y: auto; /* 若內容傷長，就出現垂直絞動軸 */
    position: relative; /* 重要：予連結定位 */
}

#pdf-container {
    position: relative; /* 重要：予連結定位 */
}

#pdf-container canvas {
    display: block;
    margin: 10px auto;
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.link-overlay {
    position: absolute;
    cursor: pointer;
    /* border: 1px dashed rgba(255, 0, 0, 0.5); */ /* 若想欲看著連結範圍，會使開這行 */
}

.hidden {
    display: none;
}

#loader {
    text-align: center;
    padding: 50px;
    font-size: 1.2em;
    color: #888;
}

/* 螢幕闊度提醒訊息樣式 */
#screen-width-warning {
    background-color: #fff3cd; /* 淡黃色背景 */
    color: #856404; /* 深黃/棕色文字 */
    padding: 15px;
    border: 1px solid #ffeeba;
    border-radius: 8px; /* 配合 .container ê 圓角 */
    margin-bottom: 20px; /* 佮後壁 ê H1 有淡薄仔距離 */
    text-align: left;
    position: relative; /* 予關閉鈕仔定位用 */
    z-index: 2000; /* 確保佇上頂層 */
}

#screen-width-warning p {
    margin: 0;
    padding-right: 30px; /* 留空間予關閉鈕仔 */
}

#close-warning-btn {
    position: absolute;
    top: 10px; /* 調整垂直位置 */
    right: 10px;
    background: none;
    border: none;
    font-size: 22px; /* 加大淡薄 */
    font-weight: bold;
    color: #856404;
    cursor: pointer;
    line-height: 1; /* 避免影響懸度 */
}

footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 0.9em;
    color: #777;
}

footer p {
    margin: 5px 0;
}

/* 「轉去頁頂」撳鈕 ê 樣式 */
#back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: #555; /* 背景色 */
    color: white; /* 文字 (箭頭) 顏色 */
    border: none;
    border-radius: 50%; /* 圓形 */
    cursor: pointer;
    z-index: 1000; /* 確保佇上頂層 */
    opacity: 0; /* 一開始藏起來 */
    visibility: hidden; /* 一開始藏起來 */
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out; /* 淡入淡出效果 */

    /* 用 flexbox 來共箭頭囥中央 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px; /* 箭頭大細 */
}

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

#back-to-top-btn:hover {
    background-color: #333; /* 滑鼠移過去 ê 時變較暗 */
}