.flipbook-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    height: calc(100vh - 120px); /* 可依 header/footer 高度調整 */
    box-sizing: border-box;
    background-color: #1a1a1a;
    color: #fff;
}

#loading {
    font-size: 1.2rem;
    color: #f39c12;
    margin: auto;
    text-align: center;
}

#book-container {
    display: none;
    width: 100%;
    flex: 1;
    min-height: 0;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    background-color: #1a1a1a;
}

#book-container:fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    padding: 0;
    display: flex;
}

#book-container:fullscreen #book-viewport {
    position: relative;
    width: 100%;
    height: 100%;
}

#book-viewport {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-origin: center center;
    transition: transform 0.2s ease-out;
}

#book {
    margin: 0 auto;
}

.page {
    background-color: white;
    overflow: hidden;
}

.page canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#controls {
    display: none;
    gap: 20px;
    align-items: center;
    justify-content: center;
    height: 40px;
    flex-shrink: 0;
    margin-top: 10px;
    z-index: 10;
}

#controls button {
    padding: 8px 16px;
    background-color: #619c56;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s;
}

#controls button:hover {
    background-color: #00913a;
}

#fullscreen-btn {
    background-color: #27ae60;
}

#fullscreen-btn:hover {
    background-color: #1e8449;
}

#page-info {
    font-size: 0.95rem;
}