/* --- 全螢幕專用容器樣式 --- */
.fullscreen-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative
}
.fullscreen-container:fullscreen, .fullscreen-container:-webkit-full-screen {
  overflow: hidden !important;
  height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background-color: #999
}
.book-outer a:hover {
  text-decoration: none
}
.dialect-tabs a {
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
  padding: 0.25em 1em;
  border-width: 1px;
  border-style: solid;
  border-radius: 5px;
  background-color: #fff;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5em;
  min-width: 6.5em;
  justify-content: center;
}

/* --- 上方功能按鈕專屬樣式 (無框、預設無底、黑字) --- */
a.eb-btn {
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
  padding: 4px 16px 4px 4px; /* 左側僅留 4px，配合上下 4px 形成完美同心半圓 */
  border: none;
  border-radius: 50px; /* 懸停時的膠囊狀白底 */
  background-color: transparent;
  color: #000000;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5em;
  min-width: 6.5em;
  justify-content: center;
  cursor: pointer;
}
/* --- 書本資訊區塊 --- */
.book-info {
  display: flex;
  padding: 25px;
  background: url("/hakka/ebook/shared/single_kv_bg.jpg")
}
.book-info-container {
  width: 100%;
  max-width: 1000px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: #000
}
.book-info-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.info-btn {
  display: flex;
  gap: 0.5em;
}
/* 按鈕懸停狀態：出現白底、陰影，且文字顏色交由各自 class 決定 */
a.eb-btn:hover {
  background-color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* --- SVG Icon 正圓形包裝設定 --- */
.btn-ico {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
}
.btn-ico svg {
  width: 16px;
  height: 16px;
  fill: #ffffff; /* 統一用白色充填 SVG */
}

/* --- 各按鈕獨立色彩與懸停文字變色設定 --- */

/* 1. sw-book (聽故事/閱讀繪本) */
a.sw-book .btn-ico {
  background-color: #F05F23; /* 橘色底 */
}
a.sw-book:hover {
  color: #F05F23;
}

/* 2. dl-pdf (下載學習單) */
a.dl-pdf .btn-ico {
  background-color: #2F7AFF; /* 藍色底 */
}
a.dl-pdf:hover {
  color: #2F7AFF;
}

/* 3. go-list (返回書櫃) */
a.go-list .btn-ico {
  background-color: #505050; /* 深灰底 */
}
a.go-list:hover {
  color: #505050;
}


.book-info h1 {
  font-size: 30px;
  font-weight: bold;
  margin: 0
}
.book-info ul {
  display: flex;
  gap: 2em;
  list-style: none;
  padding-left: 0;
  margin: 0;
  font-size: 18px;
}
.book-info p {
  margin: 0;
  font-size: 16px;
}
.alert-danger {
  background-color: #fdf3f2;
  color: #e74c3c;
  padding: 10px 15px;
  border-left: 4px solid #e74c3c;
  border-radius: 4px;
  margin-top: 10px;
  font-weight: bold;
  font-size: 14px;
}
/* --- 頂部操作列 (僅保留腔調置中) --- */
.top-action-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #F5AF9B;
  z-index: 100;
  padding: 15px;
  box-shadow: inset 0 1px 2px #5A321499, inset 0 0 18px #5A32144d;
}
/* --- 腔調頁籤 (Tabs) --- */
.dialect-tabs {
  display: flex;
  justify-content: center;
  gap: 1.04vw;
}
.dialect-tabs a {
  color: #5A3214;
  border-color: #5A3214;
}
.dialect-tabs a:hover {
  background: #5A3214;
  color: #fff
}
.dialect-tabs a.active {
  background: #5A3214;
  color: #fff;
  box-shadow: 0 4px 10px #1e070780;
}

/* 針對手機板：腔調頁籤改為上三下三網格排列 */
@media screen and (max-width: 768px) {
  .dialect-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
  }
  .dialect-tabs a {
    justify-content: center;
    font-size: 14px;
    padding: 8px 5px;
    text-align: center;
  }
  
  /* 手機版：書籍資訊區塊排版優化 */
  .book-info-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  .info-btn {
    order: -1; /* 將按鈕區塊拉到最上方 */
    flex-wrap: wrap; /* 若按鈕太多允許換行 */
    width: 100%;
  }
  .book-info ul {
    flex-direction: column; /* 著作人清單改為上下排列 */
    gap: 10px;
  }
}
/* =========================================
       互動專屬區塊 (包覆控制列與書本，放大不破圖)
       ========================================= */
.interactive-area {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  border-radius: 12px;
  padding-top: 60px;
  /* 配合 40px 高度的控制列縮小留白 */
  padding-bottom: 60px;
  background-color: transparent;
  box-sizing: border-box;
}
.fullscreen-container:fullscreen .interactive-area {
  flex: 1;
  height: 100%;
  max-width: 100vw;
  border-radius: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
.fullscreen-container:-webkit-full-screen .interactive-area {
  flex: 1;
  height: 100%;
  max-width: 100vw;
  border-radius: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}
/* --- 控制面板 (絕對定位，高度 40px) --- */
.controls-panel {
  background-color: #fff;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  height: 40px;
  /* 固定控制列高度 */
  backdrop-filter: blur(8px);
  padding: 0 15px;
  border-radius: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  z-index: 100;
  border: 1px solid #dfdfdf;
}
.panel-left {
  flex: 1 1 0%;
  min-width: 130px;
  display: flex;
  justify-content: flex-start;
}
.panel-center {
  flex: none;
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
}
.panel-right {
  flex: 1 1 0%;
  min-width: 130px;
  display: flex;
  justify-content: flex-end;
}
/* 圖示按鈕 */
.icon-btn {
  background: transparent;
  border: none;
  color: #34495e;
  font-size: 18px;
  /* 縮小字體以適應 40px */
  cursor: pointer;
  padding: 4px 8px;
  transition: all 0.2s ease;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover:not(:disabled) {
  background: #efefef;
  color: #2F7AFF;
  transform: translateY(-2px);
}
.icon-btn:active:not(:disabled) {
  transform: translateY(0);
}
.icon-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.icon-btn.active-state {
  color: #2F7AFF;
}
/* --- 繪本 3D 翻頁容器 --- */
.book-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-height: 80vh;
  max-width: calc(80vh * 1.45);
  z-index: 10;
}
/* ★ 專屬置中容器，負責處理封面平移，避免與翻頁套件衝突 */
#center-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 全螢幕時精準計算極限高度，防止下方裁切 */
.fullscreen-container:fullscreen .book-wrapper, .-fullscreen-container:-webkit-full-screen .book-wrapper {
  max-height: 90vh;
  max-width: calc(90vh * 1.45);
}
