html,
body {
    height: 100vh;
    /* 設定高度為視窗的 100% */
    margin: 0;
    overflow: hidden;
    /* 隱藏滾動條 */
}

.container-fluid {
    height: 100%;
    /* 確保容器高度填滿 body */
    display: flex;
    flex-direction: column;
    /* 讓子元素垂直排列 */
}

#ebook {
    flex-grow: 1;
    /* 讓圖書展示區域自動填滿剩餘空間 */
    background-color: black;
    overflow: hidden;
}

#subtitle {
    flex-grow: 1;
    /* 讓圖書展示區域自動填滿剩餘空間 */
    overflow-y: scroll;
    /* 在需要時顯示滾動條 */
}

#container {
    width: 100% !important;
    height: 100% !important;
    background: #FFF !important;
}

#topper,
#line,
.subBanner,
.dialector,
#footer {
    display: none;
}

.level_label>div {
    padding: 0.25rem !important;
    font-size: 1.5rem !important;
}

.img-fluid {
    height: 82vh;
    /* 設定圖片高度為視窗的82% */
    width: auto;
    /* 自動調整圖片寬度以保持比例 */
    object-fit: contain;
    /* 確保圖片不會被剪裁或變形 */
    display: block;
    /* 防止出現滾動條 */
    margin: 0 auto;
    /* 在圖片水平居中，如果它沒有填滿整個寬度 */
}

.topbar {
    background-color: rgba(255, 255, 255, 0.8);
}

.learn-btn {
    background-color: #58C69E;
}

.level_label {
    padding: 0 !important;
}

.level_label>div {
    font-size: 1rem !important;
}

.bar-bottom {
    height: 5vh;
}

#subtitle>.hide {
    display: none;
}

button.disabled {
    opacity: 0.5;
}

#subtitle>div {
    background-color: rgba(255, 255, 255, 0.8);
    /* 半透明背景 */
}

/* 直式（portrait） */
@media screen and (orientation: portrait) {

    /* 您的樣式 */
    #ebook>img {
        width: 100%;
        /* 讓圖片寬度等於裝置寬度 */
    }

    #subtitle {
        /* height: calc(35vh - 10vw); */
        height: 20vh;
        width: 100%;
        /* 讓文字區塊寬度等於裝置寬度 */
    }
}

@media (min-width: 768px)and (orientation: landscape) {
    #ebook>img {
        display: block;
        max-height: 82vh;
        object-fit: cover;
    }

    #subtitle {
        width: 100%;
        max-height: 40vh;
        overflow-y: auto !important;
        transition: max-height 0.5s ease-in-out;
        transition: height 0.5s ease-in-out;
    }

    #toggle-subtitle-btn {
        display: block;
    }
}

@media (max-width: 767px) and (orientation: landscape) {
    #ebook>img {
        display: block;
        width: 100%;
    }

    #subtitle {
        width: 100%;
        height: 60vh;
        overflow-y: auto !important;
        height: auto;
    }

    #toggle-subtitle-btn {
        display: none;
    }

    .page-nav i {
        color: #000;
    }
}

#toggle-subtitle-btn {
    position: absolute;
    top: -50px;
    right: 0;
    background-color: #ffcc00;
    /* 黃色背景 */
    border: none;
    /* 移除邊框 */
    padding: 0.5rem;
    /* 內邊距 */
    cursor: pointer;
    /* 指針變化顯示可點擊 */
}

/* plyr 播放器樣式 */
:root {
    --plyr-color-main: #0000001d;
}

#ebook .page-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20%;
    /* 設定區塊寬度為容器寬度的一半 */
    cursor: pointer;
    /* 將游標變為手型，表示可以點擊 */
    z-index: 1000;
}

.page-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-weight: bold;
    /* 根據您的需要設定高度 */
}

.page-nav i {
    color: #FFF;
    /* 白色箭頭 */
}

@media (hover: hover) and (pointer: fine) {
    .page-nav:hover {
        background: #ffffff24;
    }
}

.page-nav:active {
    background: #ffffff24;
}

.page-nav.left {
    left: 0;
}

.page-nav.right {
    right: 0;
}

#landscape-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    text-align: center;
    z-index: 2000;
    font-size: 1.5rem;
    justify-content: center;
    align-items: center;
    display: flex;
}
#replay-button{
    position: absolute;
    top: -160px;
    right: 0%;
    z-index: 1000;
    width: 80px;
}
#replay-button img {
    max-width: 100%; /* 控制圖片大小適應按鈕 */
    max-height: 100%; /* 控制圖片大小適應按鈕 */
}
#replay-button:hover {
    transform: scale(1.1); /* 懸停時放大效果 */
}
/* #navbar.navbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    background-color: rgba(255, 255, 255, 0.8) !important;
  } */
  /* 手機版樣式 */
@media (max-width: 767px) {
    #navbar.navbar {
      position: relative; /* 手機版保持相對定位，避免壓住圖片 */
      z-index: 1001; /* 確保在圖片上方 */
      background-color: rgba(255, 255, 255) !important;
    }
  
    .main-content {
      padding-top: 0; /* 手機版無需為主體內容增加空間 */
    }
  }
  
  /* 桌面版樣式 */
  @media (min-width: 768px) {
    #navbar.navbar {
      position: fixed; /* 固定在頂部 */
      top: 0;
      left: 0;
      right: 0;
      z-index: 1001; /* 在圖片之上 */
      background-color: rgba(255, 255, 255, 0.8) !important; /* 半透明背景 */
      transition: top 0.5s ease; /* 加入動畫效果 */
    }
  
    .main-content {
      padding-top: 60px; /* 桌面版主體內容向下移，避免被 navbar 遮擋 */
    }
  }
  a{
    text-decoration: none !important;
  }
/* 讓 tooltip 直接顯示在箭頭上 */
.tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* 小標籤樣式 */
.tooltip-text {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 5px 8px;
    font-size: 12px;
    border-radius: 5px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

/* 滑鼠懸停時顯示 Tooltip */
.tooltip-container:hover .tooltip-text {
    opacity: 1;
}