body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    background-color: #f0f0f0;
    overflow-x: hidden; /* 横スクロールバーを非表示 */
}

.viewer-container {
    width: 100%;
    max-width: 800px; /* PCでの最大幅を設定（適宜調整） */
    margin: 0 auto; /* 中央寄せ */
    position: relative; /* ボタンとページ情報の配置基準 */
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    min-height: 100vh; /* 画面の高さに合わせる */
    padding-bottom: 1px; /* 「タイトルに戻る」ボタンのための下部余白 */     
}

.manga-pages {
    display: flex;
    flex-direction: column; /* 画像を縦に並べる */
    align-items: center; /* 中央揃え */
    padding: 10px 0; /* 上下の余白 */
}

.manga-pages img {
    max-width: 100%; /* 親要素の幅に合わせて画像を縮小 */
    height: auto; /* アスペクト比を維持 */
    display: block; /* 画像の下の隙間をなくす */
    margin-bottom: 50px; /* 各画像の下に20pxの余白を追加 */
}

/* ナビゲーションボタンとページ情報の共通スタイル */
.navigation-buttons,
.page-info-container {
    position: fixed; /* 画面に固定 */
    /* top: 50%; を削除 */
    /* transform: translateY(-50%); を削除 */
    z-index: 100; /* 他の要素より手前に表示 */
}

/* 右側のナビゲーションボタン */
.navigation-buttons.right-side {
    right: 10px; /* 右端からの距離 */
    top: 50%; /* 垂直方向の中央を維持 */
    transform: translateY(-50%); /* 完全に中央揃えを維持 */
    display: flex;
    flex-direction: column; /* ボタンを縦に並べる */
    gap: 10px; /* ボタン間の隙間 */
}

/* 右端下部のページ情報コンテナ */
.page-info-container.right-side {
    right: 10px; /* 右端からの距離 */
    bottom: 10px; /* 下端からの距離 */
    background-color: rgba(0, 0, 0, 0.6); /* 半透明の黒 */
    color: #fff;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 1rem;
    text-align: center;
    min-width: 60px; /* 最小幅を設定して表示崩れを防ぐ */
    box-sizing: border-box; /* paddingを含めて幅を計算 */
}

.nav-button {
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.6); /* 半透明の黒 */
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.nav-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* 「タイトルに戻る」ボタンのスタイル */
.return-to-title-container {
    text-align: center; /* ボタンを中央寄せ */
    padding: 20px 0 30px; /* 上下の余白 */
    background-color: #f0f0f0; /* 背景色（viewer-containerの下部に合わせる） */
}

.return-button {
    display: inline-block; /* パディングやマージンが効くように */
    padding: 12px 25px;
    background-color: #007bff; /* 青色のボタン */
    color: #fff;
    text-decoration: none; /* 下線をなくす */
    border-radius: 5px;
    font-size: 1.1rem;
    transition: background-color 0.3s ease;
    border: none; /* リンクですがボタンのように見せるため */
    cursor: pointer;
}

.return-button:hover {
    background-color: #0056b3; /* ホバーで少し暗く */
}

/* スマートフォンでの調整（任意） */
@media (max-width: 768px) {
    .navigation-buttons.right-side {
        right: 5px; /* スマホではもう少し内側に */
    }
    .nav-button {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    .page-info-container.right-side {
        right: 5px; /* スマホではもう少し内側に */
        bottom: 5px; /* スマホでは下からもう少し内側に */
        padding: 6px 10px;
        font-size: 0.9rem;
    }
}