       @font-face {
            font-family: "Jolly";
            src: url('https://www.xiaozhangyu.vip/fonts/jollyregular.woff') format('woff');
            font-display: swap;
        }
        
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        
        body {
            font-family: Jolly, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #1DB799, #26B88B, #2FB97C);
            color: #fff;
            min-height: 100vh;
            margin: 0;
            padding: 0;
            padding-top: 60px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        /* 顶部导航栏 */
        .top-navbar {
            background: rgba(255, 255, 255, 0.2);
            -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
            border-radius: 0px 0px 12px 12px;
            margin-bottom: 20px;
            padding: 12px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            position: fixed;
            top: 0px;
            left: 15px;
            right: 15px;
            z-index: 1000;
        }

        .nav-left, .nav-right {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .nav-left a, .nav-right a {
            color: #f0f8ff;
            text-decoration: none;
            font-size: 16px;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            padding: 8px 12px;
            border-radius: 8px;
        }

        .nav-left a:hover, .nav-right a:hover {
            color: #ffd700;
            background: rgba(255, 255, 255, 0.25);
        }

        .nav-icon {
            font-size: 22px;
            width: 20px;
            text-align: center;
        }

        /* 游戏容器 */
        .game-container {
            position: relative;
            background-color: hsl(147deg 30.77% 84.71%);
            border-radius: 12px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
            width: auto;
            max-width: 100%;
            border: 1px solid rgba(255, 255, 255, 0.3);
            overflow: hidden;
            margin: 0 auto;
            margin-top: 20px;
            padding: 5px;
            display: inline-block;
            line-height: 0;
        }

        /* Canvas 容器 */
        #canvasHold {
            position: relative;
            margin: 0;
            padding: 0;
            display: block;
            overflow: hidden;
        }

        canvas {
            position: absolute;
            left: 0;
            top: 0;
            image-rendering: pixelated;
            display: block;
        }

        #bgcanvas { z-index: 0; }
        #canvas { z-index: 1; }
        #topcanvas { z-index: 2; }
        #addcanvas { 
            z-index: 3; 
            opacity: 1;
            transition: opacity 0.5s ease-out, transform 0.4s ease-out;
            transform-origin: center center;
        }

        /* 加载动画 */
        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #1DB799, #26B88B, #2FB97C);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 3000;
            flex-direction: column;
        }

        .loading-spinner {
            width: 50px;
            height: 50px;
            border: 5px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            border-top-color: #fff;
            animation: spin 1s ease-in-out infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .loading-text {
            color: white;
            margin-top: 20px;
            font-size: 18px;
            font-family: "Jolly";
        }

        .loading-progress {
            width: 200px;
            height: 10px;
            background: rgba(255, 255, 255, 0.3);
            border-radius: 5px;
            margin-top: 10px;
            overflow: hidden;
        }

        .loading-progress-bar {
            height: 100%;
            background: white;
            width: 0%;
            transition: width 0.5s;
            border-radius: 5px;
        }

        /* 加载动画淡出效果 */
        .loading-overlay.fade-out {
            animation: fadeOut 0.6s ease-out forwards;
        }

        @keyframes fadeOut {
            0% { opacity: 1; }
            100% { opacity: 0; visibility: hidden; }
        }

        /* 成功动画样式 */
        .success-animation {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 2001;
            display: none;
            justify-content: center;
            align-items: center;
            animation: fadeIn 0.5s ease-out;
            opacity: 1;
            transition: opacity 0.3s;
        }

        .success-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 2000;
            display: none;
            backdrop-filter: blur(5px);
        }

        .success-content {
            background: linear-gradient(135deg, #47b47d, #3a9c69);
            padding: 40px;
            border-radius: 20px;
            text-align: center;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
            max-width: 500px;
            width: 90%;
            position: relative;
            z-index: 2002;
            animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
        }

        .success-countdown {
            position: absolute;
            top: 15px;
            right: 20px;
            font-size: 24px;
            font-weight: bold;
            color: white;
            font-family: 'Jolly', sans-serif;
        }

        .success-checkmark {
            width: 100px;
            height: 100px;
            margin: 0 auto 20px;
            position: relative;
        }

        .success-checkmark__circle {
            stroke-dasharray: 166;
            stroke-dashoffset: 166;
            stroke-width: 3;
            stroke-miterlimit: 10;
            stroke: #fff;
            fill: none;
            animation: stroke 0.8s cubic-bezier(0.65, 0, 0.45, 1) forwards;
        }

        .success-checkmark__check {
            transform-origin: 50% 50%;
            stroke-dasharray: 48;
            stroke-dashoffset: 48;
            animation: stroke 0.5s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
        }

        .success-text {
            font-size: 2rem;
            margin-bottom: 10px;
            color: white;
            font-family: 'Jolly', sans-serif;
        }

        .success-subtext {
            font-size: 1.2rem;
            margin-bottom: 25px;
            color: rgba(255, 255, 255, 0.9);
            font-family: 'Jolly', sans-serif;
        }

        .success-close {
            background: linear-gradient(to right, #00b09b, #96c93d);
            color: white;
            border: none;
            padding: 12px 25px;
            border-radius: 50px;
            font-size: 1.1rem;
            cursor: pointer;
            transition: all 0.3s;
            font-weight: normal;
            font-family: 'Jolly', sans-serif;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            display: block;
            margin: 0 auto;
            width: fit-content;
            min-width: 120px;
        }

        .success-close:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
        }

        /* 粒子效果 */
        .confetti {
            position: fixed;
            width: 10px;
            height: 10px;
            background-color: #f00;
            opacity: 0;
            z-index: 2001;
        }

        /* 粒子效果 */
        .confetti {
            position: fixed;
            width: 10px;
            height: 10px;
            background-color: #f00;
            opacity: 0;
            z-index: 2001;
        }

        @keyframes stroke {
            100% { stroke-dashoffset: 0; }
        }

        @keyframes popIn {
            0% { transform: scale(0.8); opacity: 0; }
            100% { transform: scale(1); opacity: 1; }
        }

        @keyframes fadeIn {
            0% { opacity: 0; }
            100% { opacity: 1; }
        }

        /* 题目选择弹窗样式 */
        .puzzle-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 2000;
            justify-content: center;
            align-items: center;
            backdrop-filter: blur(5px);
            overflow-y: auto;
        }

        .puzzle-modal .modal-content {
            background: linear-gradient(135deg, #1DB799, #26B88B, #2FB97C);
            padding: 30px;
            border-radius: 18px;
            width: 90%;
            max-width: 700px;
            max-height: 85vh;
            overflow-y: auto;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
            position: relative;
            border: 1px solid rgba(255, 255, 255, 0.2);
            font-family: 'Jolly', sans-serif;
            margin: auto;
        }

        .puzzle-modal .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        }

        .puzzle-modal .modal-header h2 {
            margin: 0;
            color: white;
            font-size: 24px;
        }

        .puzzle-modal .close-modal {
            background: none;
            border: none;
    position: absolute;
    top: -20px;
    right: 20px;
    font-size: 80px;
    cursor: pointer;
    color: #f0f8ff;
    transition: color 0.3s;
    font-family: "Jolly";
    z-index: 10;
        }

        .puzzle-modal .close-modal:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .puzzle-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
            gap: 15px;
        }

        .puzzle-item {
            background: white;
            border-radius: 10px;
            padding: 12px;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
            text-align: center;
            position: relative;
            opacity: 0.7;
        }

        .puzzle-item:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
        }

        .puzzle-item.completed {
            opacity: 1;
        }

        .puzzle-item.locked {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .puzzle-item.locked:hover {
            transform: none;
        }

        .puzzle-preview {
            width: 60px;
            height: 60px;
            margin: 0 auto 8px;
            background: #fff;
            border-radius: 6px;
            overflow: hidden;
            border: 2px solid #eee;
        }

        .puzzle-number {
            font-size: 16px;
            color: #333;
            font-weight: 600;
        }

        .puzzle-item.completed::after {
            content: '';
            position: absolute;
            top: 5px;
            right: 5px;
            width: 20px;
            height: 20px;
            background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2327ae60'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") no-repeat center;
            background-size: 100%;
        }

        .puzzle-item.locked::after {
            content: '';
            position: absolute;
            top: 5px;
            right: 5px;
            width: 20px;
            height: 20px;
            background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237f8c8d'%3E%3Cpath d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z'/%3E%3C/svg%3E") no-repeat center;
            background-size: 100%;
        }

        .puzzle-pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
            margin-top: 20px;
            padding-top: 0px;
            border-top: 0px solid rgba(255, 255, 255, 0.2);
        }

        .puzzle-pagination button {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            padding: 8px 16px;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.3s;
            font-family: 'Jolly', sans-serif;
        }

        .puzzle-pagination button:hover:not(:disabled) {
            background: rgba(255, 255, 255, 0.3);
        }

        .puzzle-pagination button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .puzzle-pagination span {
            color: white;
            font-size: 16px;
        }
 
        /* 帮助弹窗 */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 2000;
            justify-content: center;
            align-items: center;
            backdrop-filter: blur(5px);
        }
        
        .modal-content {
            background: linear-gradient(135deg, #1DB799, #26B88B, #2FB97C);
            padding: 30px;
            border-radius: 18px;
            width: 90%;
            max-width: 500px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
            position: relative;
            border: 1px solid rgba(255, 255, 255, 0.2);
            font-family: 'Jolly', sans-serif;
        }
        
        .modal-content h2 {
            color: #ffd700;
            margin-bottom: 15px;
            border-bottom: 2px solid rgba(255, 255, 255, 0.3);
            padding-bottom: 10px;
            text-align: center;
        }
        
        .modal-content p {
            margin-bottom: 15px;
            line-height: 1.6;
            color: #f0f8ff;
        }
        
        .close-help {
            position: absolute;
            top: -20px;
            right: 20px;
            font-size: 80px;
            cursor: pointer;
            color: #f0f8ff;
            transition: color 0.3s;
            font-family: "Jolly";
        }
        
        .close-help:hover {
            color: #ffd700;
        }
		.bianhao  {
text-align:left;color:#f0f8ff;font-size:16px;font-family:Jolly;
}
.copyright{
text-align:center;color:#3F786B;font-size:20px;margin-top: 20px;font-family:Jolly;
}

.modal-content img {
    background-color: #ffffff;
    display: block;
    border-radius: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
width: 100%;
}

        @media (max-width: 900px) {
            .game-container {
                margin-top: 15px;
                padding: 20px 10px 0px 0px;
            }
        }

        @media (max-width: 768px) {
            body {
                padding-top: 70px;
            }
            
            .top-navbar {
                padding: 10px 15px;
                left: 8px;
                right: 8px;
            }
            
            .nav-icon {
                font-size: 18px;
            }
            
            .game-container {
                padding: 0px 10px 0px 0px;
                border-radius: 8px;
                margin-top: 0px;
            }
            
            .success-content {
                padding: 30px 20px;
                margin: 20px;
            }
            
            .success-checkmark {
                width: 80px;
                height: 80px;
            }
            
            .success-text {
                font-size: 1.5rem;
            }
            
            .success-subtext {
                font-size: 1rem;
            }
        }

        @media (max-width: 600px) {
            body {
                padding-top: 70px;
            }
            
            .nav-left a, .nav-right a {
                padding: 6px 8px;
                font-size: 14px;
            }
            
            .nav-icon {
                font-size: 16px;
            }
            
            .game-container {
                padding: 15px 5px 0px 0px;
                border-radius: 6px;
                margin-top: -10px;
            }
        }

        @media (max-height: 700px) {
            body {
                padding-top: 65px;
            }
            
            .top-navbar {
                padding: 8px 10px;
            }
            
            .nav-icon {
                font-size: 14px;
            }
            
            .game-container {
                padding: 2px;
                margin-top: 0px;
            }
        }
		        /* 翻页按钮样式 */
        .page-nav-buttons {
            position: fixed;
            bottom: 30px;
            left: 0;
            right: 0;
            display: flex;
            justify-content: space-between;
            padding: 0 30px;
            z-index: 999;
            pointer-events: none;
        }

        .page-nav-btn {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            color: #fff;
            cursor: pointer;
            opacity: 0.7;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
            pointer-events: auto;
            background: linear-gradient(145deg, #47b47d, #3a9c69);
        }

        .page-nav-btn:hover {
            opacity: 1;
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
        }

        .page-nav-btn a {
            color: white;
            text-decoration: none;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
        }