        @import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap');

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Nunito', sans-serif;
            background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
            min-height: 100vh;
            padding: 20px;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: white;
            border-radius: 20px;
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
            overflow: hidden;
        }

        .header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 30px;
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .header::before {
            content: '🌟';
            position: absolute;
            top: 10px;
            left: 50px;
            font-size: 30px;
            animation: twinkle 2s infinite;
        }

        .header::after {
            content: '✨';
            position: absolute;
            bottom: 10px;
            right: 50px;
            font-size: 25px;
            animation: twinkle 2s infinite 1s;
        }

        @keyframes twinkle {
            0%, 100% { opacity: 0.5; transform: scale(1); }
            50% { opacity: 1; transform: scale(1.2); }
        }

        .header h1 {
            font-size: 2.5rem;
            margin-bottom: 10px;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
        }

        .header p {
            font-size: 1.2rem;
            opacity: 0.9;
        }

        footer {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            text-align: center;
            padding: 20px;
            font-size: 0.9rem;
        }

        .controls {
            padding: 30px;
            background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 20px;
            flex-wrap: wrap;
        }

        .control-group {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        label {
            font-weight: 600;
            color: #2d3436;
            font-size: 1.1rem;
        }

        select, button {
            padding: 12px 20px;
            border: none;
            border-radius: 25px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        select {
            background: white;
            color: #2d3436;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        }

        select:focus {
            outline: none;
            box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
        }

        .btn {
            background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
            color: white;
            box-shadow: 0 4px 15px rgba(116, 185, 255, 0.4);
            position: relative;
            overflow: hidden;
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(116, 185, 255, 0.6);
        }

        .btn:active {
            transform: translateY(0);
        }

        .print-btn {
            background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
            box-shadow: 0 4px 15px rgba(0, 184, 148, 0.4);
        }

        .print-btn:hover {
            box-shadow: 0 8px 25px rgba(0, 184, 148, 0.6);
        }

        .game-area {
            padding: 30px;
            text-align: center;
            background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
            min-height: 400px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .maze-info {
            background: rgba(255,255,255,0.9);
            padding: 15px 30px;
            border-radius: 20px;
            margin-bottom: 20px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        }

        .maze-info h3 {
            color: #2d3436;
            font-size: 1.4rem;
            margin-bottom: 5px;
        }

        .maze-info p {
            color: red;
            font-weight: bold;
            font-size: 1rem;
        }

        .maze-container {
            background: white;
            border-radius: 20px;
            padding: 20px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            margin-bottom: 20px;
            position: relative;
        }

        .maze-canvas {
            border-radius: 15px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        }

        .start-marker, .end-marker {
            font-size: 24px;
            animation: bounce 2s infinite;
        }

        .difficulty-indicator {
            position: absolute;
            top: -10px;
            right: 20px;
            background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
            color: white;
            padding: 8px 16px;
            border-radius: 20px;
            font-weight: 600;
            font-size: 0.9rem;
            box-shadow: 0 4px 15px rgba(162, 155, 254, 0.4);
        }

        .timer, .achievement {
            background: rgba(255,255,255,0.9);
            padding: 10px 20px;
            border-radius: 15px;
            margin: 10px 0;
            color: #2d3436;
            font-weight: 600;
        }

        .shop, .leaderboard {
            margin: 10px 0;
        }

        .shop-panel, .leaderboard-panel, .instructions-panel, .modal-panel {
            background: rgba(255,255,255,0.95);
            padding: 20px;
            border-radius: 20px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 10;
            max-height: 80vh;
            overflow-y: auto;
            max-width: 90%;
            text-align: left;
        }

        .modal-panel {
            z-index: 20;
            max-width: 400px;
            width: 90%;
            text-align: center;
        }

        .modal-panel h3 {
            color: #2d3436;
            font-size: 1.4rem;
            margin-bottom: 10px;
        }

        .modal-panel p {
            color: #2d3436;
            font-size: 1.1rem;
            margin-bottom: 20px;
        }

        .modal-panel .btn {
            background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
        }

        .shop-items div, .leaderboard-items div {
            margin: 10px 0;
            font-size: 1rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .instructions-panel p {
            margin: 10px 0;
            font-size: 1rem;
            color: #2d3436;
        }

        .fun-message {
            background: rgba(255,255,255,0.9);
            padding: 15px 25px;
            border-radius: 20px;
            color: #2d3436;
            font-size: 1.1rem;
            font-weight: 600;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
            margin-top: 15px;
        }

        input[type="checkbox"] {
            width: 20px;
            height: 20px;
            cursor: pointer;
            accent-color: #74b9ff;
            vertical-align: middle;
        }

        .control-group input[type="checkbox"] + label {
            margin-left: 5px;
        }

        .shop-panel button {
            margin: 10px 5px;
        }

        .shop-panel button[onclick="clearAnimal()"] {
            background: linear-gradient(135deg, #ff7675 0%, #d63031 100%);
            box-shadow: 0 4px 15px rgba(255, 118, 117, 0.4);
        }

        .shop-panel button[onclick="clearAnimal()"]:hover {
            box-shadow: 0 8px 25px rgba(255, 118, 117, 0.6);
            transform: translateY(-2px);
        }

        .shop-panel button[onclick="clearAnimal()"]:active {
            transform: translateY(0);
        }

        .shop-panel button[onclick="clearAnimal()"]:disabled {
            background: linear-gradient(135deg, #b2bec3 0%, #636e72 100%);
            box-shadow: none;
            cursor: not-allowed;
            opacity: 0.6;
        }

        @media print {
            body {
                background: white;
                padding: 0;
            }

            .container {
                box-shadow: none;
                border-radius: 0;
            }

            .controls, .header, .fun-message, .timer, .achievement, .shop, .leaderboard, 
            .shop-panel, .leaderboard-panel, .instructions-panel, .modal-panel, 
            .controls button[onclick="showInstructions()"], .control-group input[id="coinChallenge"],
            .virtual-keypad {
                display: none;
            }

            .game-area {
                background: white;
                padding: 20px;
            }

            .maze-container {
                box-shadow: none;
                page-break-inside: avoid;
            }

            .maze-info {
                display: none !important;
            }

            .header {
                display: block !important;
            }
        }

        @media (max-width: 768px) {
            .header h1 {
                font-size: 2rem;
            }

            .controls {
                flex-direction: column;
                gap: 15px;
            }

            .control-group {
                width: 100%;
                justify-content: center;
            }

            select, button {
                padding: 10px 16px;
                font-size: 0.9rem;
            }

            .modal-panel {
                max-width: 80%;
            }
        }

        .special-links.simple-links {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
            margin-bottom: 20px;
            font-weight: bold;
            font-size: 18px;
        }
        .special-links.simple-links a {
            font-weight: bold;
            font-size: 20px;
            color: #fff;
            text-decoration: none;
            position: relative;
            z-index: 1;
            padding: 4px 18px;
            border-radius: 16px;
            background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
            box-shadow: 0 2px 8px rgba(255, 154, 158, 0.18);
            text-shadow: 0 2px 8px #c94f7c, 0 0 2px #4A1E6E;
            transition: box-shadow 0.3s, text-shadow 0.3s, background 0.3s;
            margin: 0 2px;
        }
        .special-links.simple-links a:hover {
            box-shadow: 0 4px 16px #fecfef, 0 0 20px #ff9a9e;
            background: linear-gradient(135deg, #fecfef 0%, #ff9a9e 100%);
            text-shadow: 0 0 8px #A568AD, 0 0 16px #fecfef, 0 0 24px #ff9a9e;
        }
        .special-links.simple-links .link-sep {
            color: #ff6b6b;
            margin: 0 10px;
            font-weight: bold;
            font-size: 22px;
            text-shadow: 0 1px 6px #4A1E6E;
        }
        /* 虚拟键盘美化 */
.virtual-keypad {
    position: absolute;
    z-index: 10;
    pointer-events: none;
    width: 140px;
    height: 140px;
    left: 0; top: 0;
    transition: left 0.2s, top 0.2s;
    background: none;
}
.virtual-keypad-inner {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 140px; height: 140px;
    pointer-events: none;
}
.virtual-keypad .direction-btn {
    position: absolute;
    width: 60px; height: 50px;
    border-radius: 6px;
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: #fff;
    font-size: 1.8rem;
    box-shadow: 0 2px 8px rgba(116,185,255,0.18);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s, transform 0.2s, background 0.2s;
    outline: none;
    pointer-events: auto;
    opacity: 0.3;
}
.virtual-keypad .direction-btn#btn-up    { left: 50%; top: 0;    transform: translate(-50%, -60%); }
.virtual-keypad .direction-btn#btn-down  { left: 50%; bottom: 0; transform: translate(-50%, 60%); }
.virtual-keypad .direction-btn#btn-left  { left: 0; top: 50%;    transform: translate(-60%, -50%); }
.virtual-keypad .direction-btn#btn-right { right: 0; top: 50%;   transform: translate(60%, -50%); }
.virtual-keypad .direction-btn:hover {
    background: linear-gradient(135deg, #0984e3 0%, #74b9ff 100%);
    box-shadow: 0 6px 18px rgba(116,185,255,0.28);
    transform: scale(1.08);
}
.virtual-keypad .direction-btn:active {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
    box-shadow: 0 2px 8px rgba(0,184,148,0.18);
    transform: scale(0.96);
}
@media (max-width: 600px) {
    .virtual-keypad, .virtual-keypad-inner { width: 180px; height: 180px; }
    .virtual-keypad .direction-btn { width: 90px; height: 60px; font-size: 2.2rem; border-radius: 18px; }
}
.maze-center-overlay {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 10;
}
.avatar-and-keypad {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 180px;
  height: 180px;
  pointer-events: none;
}
.player-avatar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.8rem;
  z-index: 2;
  background: rgba(255,255,255,0.8);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 8px;
  pointer-events: none;
}
.avatar-and-keypad .direction-btn {
  position: absolute;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
  color: #fff;
  font-size: 1.8rem;
  box-shadow: 0 2px 8px rgba(116,185,255,0.18);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s, transform 0.2s, background 0.2s;
  outline: none;
  pointer-events: auto;
  opacity: 0.92;
}
.avatar-and-keypad .direction-btn.up    { left: 50%; top: 0;    transform: translate(-50%, -60%); }
.avatar-and-keypad .direction-btn.down  { left: 50%; bottom: 0; transform: translate(-50%, 60%); }
.avatar-and-keypad .direction-btn.left  { left: 0; top: 50%;    transform: translate(-60%, -50%); }
.avatar-and-keypad .direction-btn.right { right: 0; top: 50%;   transform: translate(60%, -50%); }
.avatar-and-keypad .direction-btn:hover {
  background: linear-gradient(135deg, #0984e3 0%, #74b9ff 100%);
  box-shadow: 0 6px 18px rgba(116,185,255,0.28);
  transform: scale(1.08);
}
.avatar-and-keypad .direction-btn:active {
  background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
  box-shadow: 0 2px 8px rgba(0,184,148,0.18);
  transform: scale(0.96);
}
@media (max-width: 600px) {
  .avatar-and-keypad { width: 120px; height: 120px; }
  .player-avatar { font-size: 1.6rem; padding: 4px; }
  .avatar-and-keypad .direction-btn { width: 32px; height: 32px; font-size: 1.1rem; }
}
.video-tip {
    text-align: center;
    color: #000000;
    font-weight: bold;
    margin-top: 1px;
    margin-bottom: 1px;
    font-size: 1rem;
    background: rgba(255, 245, 200, 0.95);
    border-radius: 25px;
    padding: 6px 0 4px 0;
    letter-spacing: 1px;
    border: 2px solid red;
    width: 100%;
    box-sizing: border-box;
    display: block;
}
@media (max-width: 600px) {
  .special-links.simple-links {
    flex-direction: column;
    gap: 4px;
    font-size: 15px;
  }
  .special-links.simple-links a {
    font-size: 16px;
    padding: 4px 10px;
    margin: 2px 0;
    border-radius: 12px;
  }
  .special-links.simple-links .link-sep {
    font-size: 16px;
    margin: 0 2px;
  }
  .video-tip {
    font-size: 0.85rem;
    padding: 4px 2px 2px 2px;
    border-radius: 15px;
    word-break: break-all;
    white-space: normal;
  }
}