* {
            -webkit-tap-highlight-color: transparent;
            -webkit-touch-callout: none;
        }

        html, body {
            height: 100%;
            min-height: 100%;
            margin: 0;
            padding: 0;
        }

        :root {
            --app-height: 100vh;
        }

        body {
            touch-action: manipulation;
            font-family: 'Noto Sans SC', sans-serif;
            background: url('../assets/pf_bg.jpg') no-repeat center center;
            background-size: cover;
            color: #fff;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            position: relative; /* 为角落图定位做准备 */
            overflow-x: hidden; /* 防止装饰图溢出 */
        }


        .header {
            padding: 20px;
            margin-top: 40px;
            opacity: 0;
            transform: translateY(-20px);
            animation: fadeInDown 1s ease forwards;
        }

        .header-title-group {
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 10px; /* Space between logo/h1 group and h2 */
        }

        @keyframes fadeInDown {
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .logo {
            width: 50px;    
            height: 50px;
            margin-right: 15px; /* Space between logo and h1 */
            border-radius: 50%;
            overflow: hidden;
            padding-top: 5px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        }

        .logo img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        h1 {
            font-size: 2.2em;
            margin: 0; /* Remove default margin to align with flex */
            opacity: 0;
            animation: fadeIn 1s ease 0.3s forwards;
        }

        h2 {
            font-size: 1.7em;
            margin-top: 0;
            margin-bottom: 20px;
            opacity: 0;
            animation: fadeIn 1s ease 0.6s forwards;
        }

        @keyframes fadeIn {
            to {
                opacity: 1;
            }
        }

        .video-container {
            width: 90%;
            max-width: 1200px;
            margin: 20px auto;
            opacity: 0;
            animation: fadeIn 1s ease 0.9s forwards;
            position: relative;
            border-radius: 20px;
            border: 5px solid #2F7DDA;
            overflow: hidden;
        }

        /* 16:9 ratio wrapper */
        .video-wrapper {
            position: relative;
            padding-top: 56.25%; /* 16:9 aspect ratio */
            height: 0;
        }

        .video-wrapper video {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border-radius: 16px;
            display: block;
            z-index: 1; /* 或更低：0 */
        }

        /* 首帧图片样式 */
        .video-poster {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border-radius: 16px;
            object-fit: cover;
            z-index: 2; /* 在视频之上 */
            transition: opacity 0.3s ease;
        }

        .video-poster.hidden {
            opacity: 0;
            pointer-events: none;
        }

        /* 答题结果动画 */
        @keyframes fadeInOut {
            0% {
                opacity: 0;
                transform: translate(-50%, -50%) scale(0.8);
            }
            20% {
                opacity: 1;
                transform: translate(-50%, -50%) scale(1.1);
            }
            80% {
                opacity: 1;
                transform: translate(-50%, -50%) scale(1);
            }
            100% {
                opacity: 0;
                transform: translate(-50%, -50%) scale(0.9);
            }
        }

        .play-pause-button {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 60px;
            height: 60px;
            background-color: #3282DB;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            z-index: 10;
            transition: background-color 0.3s ease;
            padding: 0;
        }

        .play-pause-button:hover {
            background-color: #4299e1; /* 鼠标悬停时颜色加深 */
        }

        .play-pause-button::before {
            content: ''; /* 移除旧的播放三角形 unicode */
        }

        .play-pause-button.paused::before {
            content: ''; /* 移除旧的暂停图标 unicode */
        }

        /* Custom play/pause button styles */
        .play-icon, .pause-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
        }
        .message {
            text-align: center;
        }
        .play-icon img {
            display: block;
            width: 40%;
            height: 40%;
            object-fit: contain;
            padding-left: 3px; /* 由于图片不居中，微调一下位置 */
        }
        .pause-icon img {
            display: block;
            width: 40%;
            height: 40%;
            object-fit: contain;
        }

        /* Custom Video Controls Styles */
        .video-controls {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            background-color: rgba(73, 79, 87, 0.5); /* 半透明背景 */
            padding: 10px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom-left-radius: 12px;
            border-bottom-right-radius: 12px;
            opacity: 0;
            transition: opacity 0.3s ease;
            box-sizing: border-box; /* Include padding in width */
            z-index: 2;
        }

        .video-controls {
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: none;
            z-index: 2;
        }

        .video-controls.visible {
            opacity: 1;
            pointer-events: auto;
            z-index: 2;
        }

        .progress-bar-container {
            flex-grow: 1;
            height: 5px;
            background-color: #C9D0D8; /* 进度条背景颜色 */
            border-radius: 2.5px;
            margin: 0 10px;
            overflow: hidden; /* Ensure inner bar doesn't overflow */
            cursor: default; /* Disable cursor for seeking */
        }

        .progress-bar {
            height: 100%;
            width: 0%;
            background-color: #4299e1; /* 进度条颜色 */
            border-radius: 2.5px;
            transition: width 0.1s linear; /* Smooth progress update */
        }

        .time-display {
            color: #fff;
            font-size: 0.9em;
            white-space: nowrap; /* Prevent time from wrapping */
            margin-right: 5px;
        }

        /* Quiz Trigger Button Styles */
        @keyframes slideInUp {
            0% {
                transform: translate(-50%, 100px);
                opacity: 0;
            }
            100% {
                transform: translate(-50%, -50%);
                opacity: 1;
            }
        }

        @keyframes pulse {
            0% {
                transform: translate(-50%, -50%) scale(1);
            }
            50% {
                transform: translate(-50%, -50%) scale(1.1);
            }
            100% {
                transform: translate(-50%, -50%) scale(1);
            }
        }

        .quiz-trigger-button {
            /* 动画 */
            cursor: pointer;
            /* 原来样式 */
            position: fixed;
            top: 50%;
            left: 50%;
            /* 初始状态用于动画 */
            transform: translate(-50%, 100px); /* 从屏幕下方开始 */
            opacity: 0;
            display: none; /* 默认隐藏 */
            background-color: #FBD77C; /* 浅蓝背景，10%透明度 */
            color: #004A9B; /* 白色文字 */
            padding: 12px 28px;
            /* border: 3px solid #2F7DDA; */ /* 与视频容器一致的边框色 */
            border-radius: 30px;
            font-size: 1.2em;
            font-weight: 600;
            cursor: pointer;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            transition: all 0.5s ease-out; /* 平滑的初始出现过渡 */
            pointer-events: none;
            z-index: 101; /* 确保在蒙版之上 */
        }

        .quiz-trigger-button.visible {
            display: block; /* 显示按钮 */
            top: 50%; /* 垂直居中 */
            opacity: 1;
            animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards,
                      pulse 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite 0.6s;
            pointer-events: auto; /* 可点击 */
        }

        /* Modal Styles */
        .modal {
            display: none; /* Add this to hide by default */
            justify-content: center;
            align-items: center;
            position: fixed; /* Stay in place */
            z-index: 9999; /* 提高z-index确保在最顶层 */
            left: 0;
            top: 0;
            width: 100%; /* Full width */
            height: 100%; /* Full height */
            overflow: auto; /* Enable scroll if needed */
            background-color: rgba(0, 0, 0, 0.7); /* Black w/ opacity */
            backdrop-filter: blur(5px); /* Optional: blur background */
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: auto; /* 确保可以接收点击事件 */
        }

        .modal.visible {
            display: flex; /* Override to show */
            opacity: 1;
        }

        .modal-content {
            display: block; /* 改为block，避免display:none导致的点击问题 */
            background-color: #ffffff;
            padding: 30px 24px;
            border-radius: 16px;
            max-width: 500px;
            width: 90%;
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
            text-align: center;
            font-family: 'Noto Sans SC', sans-serif;
            margin: 20px;
            color: #0A2F6C; /* 主文字深蓝 */
            position: relative; /* 确保定位正确 */
            z-index: 10000; /* 确保内容在遮罩之上 */
        }

        .modal-content h3 {
            font-size: 1.3em;
            font-weight: bold;
            color: #0A2F6C;
            margin-bottom: 24px;
            line-height: 1.6;
        }



        .modal.visible .modal-content {
            transform: translateY(0); /* Slide down into place */
            opacity: 1;
        }

        .close-button {
            position: absolute;
            top: 14px;
            right: 16px;
            font-size: 24px;
            background-color: #eee;
            width: 30px;
            height: 30px;
            line-height: 30px;
            border-radius: 50%;
            text-align: center;
            color: #333;
            cursor: pointer;
            transition: background-color 0.2s ease;
            padding-bottom: 2px;
        }

        /* .close-button:hover {
            background-color: #ccc;
        } */

        .close-button:hover,
        .close-button:focus {
            color: #ccc;
            text-decoration: none;
            cursor: pointer;
        }

        .options-container {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-top: 20px;
        }

        .option-item {
            background-color: #E9F4FF; /* 浅蓝底色 */
            border: 2px solid #C7E3FF; /* 边框也偏浅蓝 */
            color: #0A2F6C; /* 深蓝字体 */
            padding: 14px 16px;
            border-radius: 12px;
            font-size: 1em;
            text-align: left;
            cursor: pointer;
            transition: all 0.2s ease;
            box-shadow: none;
        }

        .option-item:hover {
            background-color: #d4ebff;
        }


        .option-item.correct {
            background-color: #0C9C83;  /* 蓝绿调，更沉稳 */
            color: #ffffff;
            border-color: #0C9C83;
        }


        .option-item.wrong {
            background-color: #D6455F;  /* 更柔和且高对比 */
            color: #ffffff;
            border-color: #D6455F;
        }

        /* 答题结果弹窗样式 */
        .result-content {
            text-align: left;
            margin-top: 20px;
        }

        .result-content h4 {
            color: #2F7DDA;
            margin: 15px 0 8px 0;
            font-size: 16px;
            font-weight: 600;
        }

        .result-content p {
            margin: 8px 0;
            line-height: 1.5;
            padding: 10px;
            border-radius: 8px;
            background-color: #f8f9fa;
            border-left: 4px solid #dee2e6;
        }

        .answer-text {
            font-weight: 500;
        }

        .answer-text.correct {
            background-color: #d4edda;
            border-left-color: #28a745;
            color: #155724;
        }

        .answer-text.wrong {
            background-color: #f8d7da;
            border-left-color: #dc3545;
            color: #721c24;
        }

        .result-status {
            text-align: center;
            margin-top: 20px;
            padding: 15px;
            border-radius: 10px;
            font-weight: bold;
            font-size: 18px;
        }

        .result-status.correct {
            background-color: #d4edda;
            color: #155724;
            border: 2px solid #28a745;
        }

        .result-status.wrong {
            background-color: #f8d7da;
            color: #721c24;
            border: 2px solid #dc3545;
        }


        /* Lottery Button Styles */
        .lottery-button {
            position: fixed;
            left: 50%;
            bottom: 80px;
            transform: translateX(-50%);
            background: linear-gradient(135deg, #FBD77C, #FFA500); /* 金色渐变背景 */
            color: #fff;
            padding: 10px 30px;
            border: none;
            border-radius: 32px;
            font-size: 1.2em;
            font-weight: bold;
            cursor: pointer;
            box-shadow: 0 8px 20px rgba(255, 193, 7, 0.3);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            opacity: 0;
            text-align: center;
            white-space: nowrap;
            display: none; /* 初始隐藏 */
            z-index: 99;
            line-height: 1.4;
        }

        .lottery-button.visible {
            display: block;
            opacity: 1;
            animation: pulse 1.5s infinite;
        }

        .lottery-button:hover {
            transform: translateX(-50%) scale(1.06);
            box-shadow: 0 10px 24px rgba(255, 193, 7, 0.5);
        }

        .pf-title {
            position: relative;
            width: 100%;
            text-align: center;
            margin-top: 32px;
            z-index: 2;
        }
        .pf-title img {
            max-width: 55vw;
            height: auto;
        }

        .pf-content-bg {
            position: relative;
            width: 90vw;
            max-width: 420px;
            margin: 16px auto 0 auto;
            z-index: 2;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        .pf-content-bg-img {
            width: 95%;
            display: block;
        }
        .pf-content-inner {
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            pointer-events: none;
        }
        .pf-content-title {
            width: 80%;
            margin-top: 1%;
        }
        .pf-content-detail {
            width: 65%;
            margin-top: 3%;
        }

        #main-content-wrapper {
            position: relative;
            min-height: var(--app-height);
            width: 100vw;
            box-sizing: border-box;
            padding-bottom: 240px;
            background: url('../assets/pf_bg.jpg') no-repeat center center;
            background-size: cover;
        }

        .pf-cheng {
            position: absolute;
            left: 0;
            bottom: 0;
            width: 120px;
            max-width: 30vw;
            z-index: 3;
            padding: 60px 10px;
        }

        .pf-lottery-brief {
            position: absolute;
            right: 0;
            bottom: 0;
            width: 300px;
            z-index: 3;
            padding: 190px 30px;
        }

        .animated {
            opacity: 0;
            transform: translateY(40px) scale(0.98);
            transition: opacity 0.7s cubic-bezier(.4,0,.2,1), transform 0.7s cubic-bezier(.4,0,.2,1);
        }
        .animated.visible {
            opacity: 1;
            transform: translateY(0) scale(1);
        }

        #main-content {
            display: none !important;
        }

        /* 移除原有四角背景装饰图样式和相关定位 */
        .bg-decor, .top-left, .top-right, .bottom-left, .bottom-right {
            display: none !important;
        }

        .pf-cheng,
        .pf-lottery-brief,
        .pf-title,
        .pf-content-bg {
            pointer-events: none;
        }

        @media (max-height: 700px) {
            .pf-lottery-brief {
                position: absolute;
                right: 0;
                bottom: 0;
                width: 240px;
                z-index: 3;
                padding: 100px 10px;

            }
        }