/******* Do not edit this file *******
Simple Custom CSS and JS - by Silkypress.com
Saved: Jul 08 2026 | 12:05:53 */
/* ═══════════════════════════════════════
   統一感のある目次戻りボタン
   修正：
     BUG-1: transition: all → 個別プロパティに変更
     BUG-2: width: fit-content に -webkit- プレフィックスを追加
     BUG-3: prefers-reduced-motion 対応を追加
     BUG-4: will-change: transform に統一（translateZ(0) は削除）
     BUG-5: contain: layout style を追加
   ═══════════════════════════════════════ */

.toc-return-btn {
    /* 中央配置 */
    display: block !important;
    margin: 32px auto 24px auto !important;
    /* ★修正BUG-2：-webkit- プレフィックスを追加（iOS Safari 15.3以前対応） */
    width: -webkit-fit-content !important;
    width: fit-content !important;

    /* デザイン */
    padding: 12px 28px !important;
    font-family: 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic', sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    letter-spacing: 1px !important;
    border-radius: 50px !important;

    /* グラデーション */
    background: linear-gradient(
        135deg,
        #667eea 0%,
        #764ba2 100%
    ) !important;
    background-size: 200% 200% !important;

    color: #fff !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer !important;

    /* シャドウ */
    box-shadow:
        0 8px 32px rgba(102, 126, 234, 0.4),
        0 4px 16px rgba(118, 75, 162, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;

    /*
     * ★修正BUG-1：transition: all → 実際に変化する3プロパティのみに限定。
     * 元コードは all で全プロパティを毎フレーム監視していた。
     */
    transition:
        transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow 0.4s ease,
        filter 0.2s ease !important;

    /* 浮遊アニメーション */
    animation: gentleFloat 3s ease-in-out infinite !important;

    /* 文字の影 */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;

    /* GPU最適化 */
    backface-visibility: hidden !important;
    /*
     * ★修正BUG-4：transform: translateZ(0) を will-change に置き換え。
     * translateZ(0) はGPU昇格の古いハック。
     * will-change: transform が現代的な正しいアプローチ。
     * ただし常時アニメーション中の要素なので、will-change は適切。
     */
    will-change: transform !important;

    position: relative !important;
    overflow: hidden !important;

    /* ★修正BUG-5 */
    contain: layout style !important;
}

/* ホバー時 */
@media (hover: hover) and (pointer: fine) {
    .toc-return-btn:hover {
        animation-play-state: paused !important;
        transform: translateY(-4px) scale(1.05) !important;
        background-position: 100% 0 !important;
        box-shadow:
            0 12px 40px rgba(102, 126, 234, 0.5),
            0 6px 20px rgba(118, 75, 162, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
        filter: brightness(1.1) !important;
    }
    .toc-return-btn:hover::before {
        left: 100% !important;
    }
}

/* アクティブ時 */
.toc-return-btn:active {
    transform: translateY(-2px) scale(1.02) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

/* スマホ調整 */
@media (max-width: 768px) {
    .toc-return-btn {
        font-size: 12px !important;
        padding: 10px 22px !important;
        margin: 24px auto 16px auto !important;
    }
}

/* キラキラ（シマー）効果 */
.toc-return-btn::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    ) !important;
    transition: left 0.8s ease !important;
    border-radius: 50px !important;
    z-index: 1 !important;
}

/* 浮遊アニメーション */
@keyframes gentleFloat {
    0%   { transform: translateY(0); }
    50%  { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}

/*
 * ★修正BUG-3：prefers-reduced-motion 対応（最重要）。
 * gentleFloat は3秒ループで常時動き続けるため、
 * 前庭障害のユーザーや「動きを減らす」設定のユーザーへの影響が大きい。
 * アニメーションを完全停止し、ボタンを静止させる。
 * また will-change も解除してGPUリソースを開放する。
 */
@media (prefers-reduced-motion: reduce) {
    .toc-return-btn {
        animation: none !important;
        will-change: auto !important;
        transition: none !important;
        transform: none !important;
    }
    .toc-return-btn:hover {
        transform: none !important;
        filter: brightness(1.1) !important; /* hover の視覚フィードバックは残す */
    }
    .toc-return-btn::before {
        transition: none !important;
    }
    .toc-return-btn:active {
        transform: none !important;
        transition: none !important;
    }
}

/* スムーススクロール */
html {
    scroll-behavior: smooth !important;
    scroll-padding-top: 50px !important; /* 固定ヘッダーの高さに合わせて調整 */
}