body { 
    margin: 0; 
    font-family: sans-serif; 
    text-align: center; 
}
#openBook { 
    margin: 0px; 
    padding: 10px 20px;
    border: none;
    cursor: pointer;
}
.overlay {
    display: none;
    /*display: block;*/
    position: fixed;
    top: 0; 
    left: 0;
    width: 100vw; 
    height: 100vh;
    background: rgba(255,255,255,0.6); /* 灰色背景 */
    z-index: 999;
}
.modal {
    /*position: relative;*/
    position: absolute;
    width: 90vw;
    height: 90vh;
    background: transparent;
    margin: auto;
    box-shadow: none; /* 如果不想要陰影也可以移除 */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    top: 5vh;
    left: 5vw;
    cursor: move;
    /*overflow: auto; /*允許內容超出並可捲動 */
    background: rgba(22,22,22,0.8);
}
.closeBtn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 36px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    z-index: 1000;
}
.page {
    width: 100%;
    height: 100%;
    display: block;
    overflow: hidden;
    z-index: 1;
}
.page canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
/*
.arrow-controls {
    position: absolute;
    pointer-events: none; /* 整個容器不攔截事件 
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}
.arrow-controls button {
    user-select: none;      /* 禁止文字或圖片被選取 
    -webkit-user-drag: none;/* 禁止拖曳圖片 
    pointer-events: auto; /* 只有按鈕能接收事件 
    font-size: 32px;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
}
*/
/* ===== 翻頁箭頭控制 ===== */
.arrow-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    display: flex;
    justify-content: center;   /* 水平置中 */
    align-items: center;       /* 垂直置中 */
}
.arrow-controls button {
    background: rgba(159,154,154,0.9);
    border: none;
    margin: 0 10px;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}
.arrow-controls button:hover {
    background: rgba(255,255,255,0.5);
}
.arrow-controls img {
    width: 32px;
    height: 32px;
}

#flipbook {
    display: none; /*預設隱藏，載入完成後再顯示 */
    width: 90%;
    height: 90%;
    cursor: zoom-in;
    /*position: relative;*/
    flex-shrink: 0;
    position: absolute;
    left: 0px; /* 初始位置可自訂 */
    top: 0px;
    cursor: grab;
    z-index: 10;
}    
#flipbook .page {
    width: 100%;
    height: 100%;
    pointer-events: none;
}
#flipbook .page canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}
#loadingText{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 26px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
    z-index: 1002;
    display: none;  
} 
#loadingIcon {
    position: absolute;
    top: 43%; /* 在文字下方 */
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90px;
    height: 90px;
    z-index: 1003;
    display: none;
    animation: spin 3s linear infinite;
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}