/* 基礎スタイル */
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
      background-color: #faf7f2;
      color: #2f2e2c;
      line-height: 1.6;
    }
    h1, h2, h3, h4, h5, h6, .brand-serif {
      font-family: 'Hiragino Mincho ProN', 'Yu Mincho', YuMincho, Georgia, serif;
      line-height: 1.4;
    }

    /* トースト通知 */
    .toast {
      position: fixed;
      bottom: 24px; left: 50%;
      transform: translateX(-50%);
      padding: 10px 20px;
      border-radius: 40px;
      background-color: #2f2e2c;
      color: white;
      font-size: 0.875rem;
      font-weight: 500;
      letter-spacing: 0.02em;
      box-shadow: 0 8px 20px rgba(0,0,0,0.15);
      z-index: 1010;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
    }
    .toast.active {
      opacity: 1;
      visibility: visible;
      transform: translateX(-50%) translateY(-4px);
    }

    /* フェードインアニメーション */
    .fade-in {
      animation: fadeIn 0.3s ease-in-out;
    }
    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    /* 画像コンテナ */
    .image-container {
      background-color: #f0efec;
      border-radius: 12px;
      border: 1px solid #e0d8cf;
      padding: 1.25rem;
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 60vh;
      margin-bottom: 2rem;
      box-shadow: 0 12px 28px -8px rgba(0,0,0,0.08);
      transition: box-shadow 0.3s;
    }
    .image-container:hover {
      box-shadow: 0 16px 32px -8px rgba(0,0,0,0.12);
    }
    .image-container img {
      max-width: 100%;
      height: auto;
      display: block;
      border-radius: 6px;
      box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    }
    .image-container.scroll-mode {
      align-items: stretch;
      flex-direction: column;
      gap: 1.5rem;
      min-height: auto;
    }
    .scroll-reader-page {
      align-items: center;
      display: flex;
      flex-direction: column;
      gap: 0.6rem;
      margin: 0;
    }
    .scroll-reader-caption {
      align-self: center;
      background-color: #fff;
      border: 1px solid #e8e0d5;
      border-radius: 999px;
      color: #7d6b5d;
      font-size: 0.78rem;
      padding: 0.25rem 0.8rem;
    }
    .scroll-reader-page img {
      max-width: 100%;
      height: auto;
      display: block;
      border-radius: 6px;
      box-shadow: 0 6px 16px rgba(0,0,0,0.12);
      margin: 0 auto;
    }
    .scroll-reader-sentinel {
      color: #7d6b5d;
      font-size: 0.85rem;
      min-height: 3rem;
      padding: 0.8rem;
      text-align: center;
    }
    .reader-scroll-loading .scroll-reader-sentinel::after {
      content: "";
      display: inline-block;
      width: 0.8rem;
      height: 0.8rem;
      margin-left: 0.5rem;
      border: 2px solid #d9cec2;
      border-top-color: #b33a3a;
      border-radius: 999px;
      vertical-align: -0.12rem;
      animation: readerSpin 0.8s linear infinite;
    }
    .scroll-reader-sentinel.is-complete {
      color: #9b8f84;
    }
    .scroll-reader-sentinel.is-ready {
      cursor: default;
    }
    .scroll-reader-sentinel.is-error {
      color: #b33a3a;
      cursor: pointer;
      font-weight: 600;
    }
    @keyframes readerSpin {
      to { transform: rotate(360deg); }
    }
    @media (max-width: 767px) {
      .image-container.scroll-mode {
        border-radius: 8px;
        gap: 1rem;
        padding: 0.75rem;
      }
      .scroll-reader-caption {
        font-size: 0.72rem;
      }
      .scroll-reader-page img {
        width: 100%;
      }
    }

    /* ボタンスタイル */
    .action-btn {
      border-radius: 6px;
      padding: 0.45rem 1rem;
      font-size: 0.8rem;
      font-weight: 500;
      line-height: 1.2;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      border: none;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.4rem;
      white-space: nowrap;
      letter-spacing: 0.02em;
    }
    .action-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 14px rgba(0,0,0,0.08);
    }
    .action-btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }
    .btn-primary {
      background-color: #b33a3a;
      color: white;
    }
    .btn-primary:hover {
      background-color: #9e2f2f;
    }
    .btn-secondary {
      background-color: #e8e0d5;
      color: #2f2e2c;
    }
    .btn-secondary:hover {
      background-color: #d9cec2;
    }

    /* ページ入力フィールド（幅はユーティリティクラスで調整） */
    .page-input {
      border: 1px solid #d9cec2;
      border-radius: 6px;
      padding: 0.45rem 0.5rem;
      font-size: 0.85rem;
      text-align: center;
      background-color: white;
      transition: border 0.2s, box-shadow 0.2s;
    }
    .page-input:focus {
      outline: none;
      border-color: #b33a3a;
      box-shadow: 0 0 0 3px rgba(179,58,58,0.15);
    }

    /* モバイルメニュー */
    .mobile-menu {
      height: 0;
      overflow: hidden;
      transition: height 0.3s ease;
      background-color: #faf7f2;
      box-shadow: 0 4px 6px -2px rgba(0,0,0,0.05);
    }
    .mobile-menu.active {
      height: auto;
      overflow: visible;
    }

    /* 年齢確認モーダル */
    .modal-overlay {
      position: fixed;
      top: 0; left: 0; width: 100%; height: 100%;
      background-color: rgba(0,0,0,0.5);
      backdrop-filter: blur(4px);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.3s, visibility 0.3s;
    }
    .modal-overlay.active {
      opacity: 1;
      visibility: visible;
    }
    .modal-content {
      background-color: #faf7f2;
      border-radius: 16px;
      box-shadow: 0 20px 40px rgba(0,0,0,0.2);
      transform: translateY(-20px);
      transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      border: 1px solid #e8e0d5;
    }
    .modal-overlay.active .modal-content {
      transform: translateY(0);
    }

    /* 作品タイトル（長い場合の処理） */
    .work-title {
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-weight: 500;
      background: rgba(255,255,255,0.6);
      padding: 0.2rem 0.6rem 0.2rem 0; /* 左パディングを0にして下部のテキストと左端を揃える */
      border-radius: 4px;
      line-height: 1.5;
    }

    /* ビューアツールバー・ページネーションバーのベーススタイル */
    .viewer-toolbar, .pagination-bar {
      background-color: white;
      border: 1px solid #e0d8cf;
      border-radius: 12px;
      padding: 1rem 1.2rem;  /* 少し余裕を持たせる */
      box-shadow: 0 4px 12px rgba(0,0,0,0.03);
      transition: box-shadow 0.2s;
    }
    .viewer-toolbar:hover, .pagination-bar:hover {
      box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    }

    /* ページ番号強調 */
    #current-page-display-header {
      font-weight: 600;
      color: #b33a3a;
      background: rgba(179,58,58,0.08);
      padding: 0.1rem 0.3rem;
      border-radius: 4px;
    }

    #total-pages-display-header {
      font-weight: 500;
      color: #7d6b5d;
    }

    .page-slash {
      margin: 0 2px;
      color: #b5a99d;
    }

    /* モバイル最適化 */
    @media (max-width: 639px) {
      .action-btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.7rem;
      }
      .page-input {
        font-size: 0.75rem;
        padding: 0.35rem 0.4rem;
      }
      .viewer-toolbar, .pagination-bar {
        padding: 0.8rem 1rem;
      }
    }
