* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', sans-serif;
    background: linear-gradient(180deg, #87CEEB 0%, #98D8C8 60%, #7CB342 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    position: relative;
    overflow-y: auto;
}

body::before {
    content: '☁️';
    position: fixed;
    top: 5%;
    left: 10%;
    font-size: 80px;
    animation: cloud-float 20s ease-in-out infinite;
    opacity: 0.8;
}

body::after {
    content: '☁️';
    position: fixed;
    top: 15%;
    right: 15%;
    font-size: 60px;
    animation: cloud-float 25s ease-in-out infinite 5s;
    opacity: 0.7;
}

@keyframes cloud-float {
    0%, 100% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(30px) translateY(-10px); }
}

.sun {
    position: fixed;
    top: 30px;
    right: 50px;
    font-size: 100px;
    animation: sun-rotate 10s linear infinite;
    z-index: 1;
}

@keyframes sun-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rainbow {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 200px;
    border-radius: 200px 200px 0 0;
    background: linear-gradient(180deg, 
        #FF6B6B 0%, 
        #FFA500 14%, 
        #FFD93D 28%, 
        #6BCB77 42%, 
        #4D96FF 56%, 
        #9B59B6 70%, 
        transparent 100%
    );
    opacity: 0.6;
    z-index: 0;
}

.flower {
    position: fixed;
    font-size: 40px;
    animation: flower-sway 3s ease-in-out infinite;
    z-index: 0;
}

.flower:nth-child(1) {
    bottom: 5%;
    left: 5%;
    animation-delay: 0s;
}

.flower:nth-child(2) {
    bottom: 8%;
    left: 15%;
    font-size: 30px;
    animation-delay: 0.5s;
}

.flower:nth-child(3) {
    bottom: 3%;
    right: 10%;
    animation-delay: 1s;
}

.flower:nth-child(4) {
    bottom: 7%;
    right: 20%;
    font-size: 35px;
    animation-delay: 1.5s;
}

@keyframes flower-sway {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.butterfly {
    position: fixed;
    font-size: 30px;
    animation: butterfly-fly 8s ease-in-out infinite;
    z-index: 2;
}

.butterfly:nth-child(5) {
    top: 40%;
    left: 8%;
    animation-delay: 0s;
}

.butterfly:nth-child(6) {
    top: 50%;
    right: 12%;
    animation-delay: 2s;
}

@keyframes butterfly-fly {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -30px) rotate(10deg); }
    50% { transform: translate(40px, 0) rotate(0deg); }
    75% { transform: translate(20px, 30px) rotate(-10deg); }
}

.star {
    position: fixed;
    font-size: 25px;
    animation: star-twinkle 2s ease-in-out infinite;
    z-index: 0;
}

.star:nth-child(7) {
    top: 25%;
    left: 25%;
    animation-delay: 0s;
}

.star:nth-child(8) {
    top: 35%;
    right: 30%;
    animation-delay: 0.5s;
}

.star:nth-child(9) {
    top: 20%;
    left: 60%;
    animation-delay: 1s;
}

@keyframes star-twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.balloon {
    position: fixed;
    font-size: 45px;
    animation: balloon-float 6s ease-in-out infinite;
    z-index: 1;
}

.balloon:nth-child(10) {
    top: 20%;
    left: 40%;
    animation-delay: 0s;
}

.balloon:nth-child(11) {
    top: 30%;
    left: 55%;
    font-size: 35px;
    animation-delay: 1s;
}

@keyframes balloon-float {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-20px) rotate(3deg); }
}

.game-container {
    background: white;
    padding: 40px;
    border-radius: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 900px;
    width: 100%;
    display: flex;
    gap: 40px;
    position: relative;
    border: 4px solid #FF6B6B;
    z-index: 10;
}

.game-container::before {
    content: '🎪';
    position: absolute;
    top: -25px;
    left: 20px;
    font-size: 45px;
    animation: bounce 2s ease-in-out infinite;
}

.game-container::after {
    content: '🎠';
    position: absolute;
    top: -20px;
    right: 20px;
    font-size: 40px;
    animation: bounce 2.5s ease-in-out infinite 0.5s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.sidebar {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.header {
    text-align: center;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #FF6B6B;
    margin-bottom: 10px;
    text-shadow: 2px 2px 0 #FFD93D;
}

.info {
    font-size: 20px;
    color: #6BCB77;
    font-weight: 600;
    background: #FFF9C4;
    padding: 10px 15px;
    border-radius: 15px;
    display: inline-block;
    border: 2px dashed #FFD93D;
    margin: 0 auto;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-buttons-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.control-btn.small {
    padding: 15px 18px;
    font-size: 16px;
    border-radius: 15px;
    white-space: nowrap;
    height: 54px;
    box-sizing: border-box;
}

.auto-check-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 24px;
    border: 3px solid #FF6B6B;
    background: #FFF9C4;
    border-radius: 20px;
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', sans-serif;
    transition: all 0.2s ease;
}

.auto-check-option:hover {
    background: #FFE066;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.auto-check-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #FF6B6B;
    cursor: pointer;
}

.auto-check-option label {
    font-size: 16px;
    font-weight: 700;
    color: #FF6B6B;
    cursor: pointer;
    margin: 0;
}

.control-btn {
    padding: 15px 24px;
    border: 3px solid #4ECDC4;
    background: #fff;
    color: #4ECDC4;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s ease;
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', sans-serif;
}

.control-btn:hover {
    background: #4ECDC4;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn::before {
    content: '';
    margin-right: 8px;
}

#new-game::before {
    content: '🎮';
}

#check::before {
    content: '✅';
}

#hint::before {
    content: '💡';
}

#fullscreen::before {
    content: '⛶';
}

.rules {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    border: 3px dashed #FFD93D;
    animation: bounce-in 0.5s ease;
}

.rules h2 {
    font-size: 16px;
    color: #FF6B6B;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.rules p {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

@keyframes bounce-in {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.board {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    background: #FF6B6B;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    max-width: 450px;
}

.box-row {
    display: flex;
    gap: 8px;
}

.box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2px;
    background: white;
    padding: 4px;
    border-radius: 10px;
}

.cell {
            width: 65px;
            height: 65px;
            background: white;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 28px;
            font-weight: 700;
            color: #333;
            cursor: pointer;
            border: 1px solid #e0e0e0;
            outline: none;
            transition: all 0.2s ease;
            border-radius: 5px;
            position: relative;
        }

.cell:hover {
    background: #FFF9C4;
    transform: scale(1.05);
    z-index: 1;
}

.cell.selected {
    background: #FFD93D;
    transform: scale(1.1);
    z-index: 2;
    box-shadow: 0 4px 15px rgba(255, 217, 61, 0.5);
}

.cell.fixed {
    color: #FF6B6B;
    font-weight: 800;
}

.cell.fixed:hover {
    background: white;
    transform: none;
}

.cell.fixed.selected {
    background: #FFD93D;
    transform: scale(1.1);
}

.cell.error {
    color: #dc2626;
    background: #ffcdd2;
    animation: shake 0.5s ease;
}

.cell.hint {
    color: #6BCB77;
    background: #c8e6c9;
    animation: pulse 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes shake-intense {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    10% { transform: translateX(-8px) rotate(-2deg); }
    20% { transform: translateX(8px) rotate(2deg); }
    30% { transform: translateX(-8px) rotate(-2deg); }
    40% { transform: translateX(8px) rotate(2deg); }
    50% { transform: translateX(-8px) rotate(-2deg); }
    60% { transform: translateX(8px) rotate(2deg); }
    70% { transform: translateX(-8px) rotate(-2deg); }
    80% { transform: translateX(8px) rotate(2deg); }
    90% { transform: translateX(-8px) rotate(-2deg); }
}

.cell.shake-intense {
    animation: shake-intense 0.8s ease-in-out;
}

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

.numpad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 400px;
}

.num {
    padding: 18px;
    border: 3px solid #FFD93D;
    background: white;
    color: #333;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 15px;
    transition: all 0.2s ease;
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', sans-serif;
}

.num:hover {
    border-color: #FF6B6B;
    background: #FFF9C4;
    transform: scale(1.1) rotate(3deg);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.num:active {
    transform: scale(0.95);
}

.num.clear {
    color: #FF6B6B;
    font-size: 18px;
    border-color: #FF6B6B;
}

@media (max-width: 800px) {
    .game-container {
        flex-direction: column;
        padding: 30px;
        gap: 30px;
    }

    .sidebar {
        flex: none;
        width: 100%;
    }

    .header {
        text-align: center;
    }

    .controls {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 500px) {
    .game-container {
        padding: 20px;
    }

    .header h1 {
        font-size: 24px;
    }

    .cell {
        width: 45px;
        height: 45px;
        font-size: 24px;
    }

    .control-btn {
        padding: 12px 18px;
        font-size: 14px;
    }

    .num {
        padding: 14px;
        font-size: 20px;
    }

    .board {
        gap: 2px;
        padding: 6px;
    }
}

/* 检查结果提示框样式 */
.check-alert {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

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

.alert-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.alert-content.success {
    border: 4px solid #6BCB77;
}

.alert-content.error {
    border: 4px solid #FF6B6B;
}

.alert-content h3 {
    font-size: 24px;
    margin: 0 0 15px 0;
    font-weight: bold;
}

.alert-content.success h3 {
    color: #6BCB77;
}

.alert-content.error h3 {
    color: #FF6B6B;
}

.alert-content p {
    font-size: 16px;
    margin: 0 0 20px 0;
    color: #333;
}

.alert-btn {
    padding: 12px 24px;
    background: #4ECDC4;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', sans-serif;
}

.alert-btn:hover {
    background: #45b7aa;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
}

.alert-btn:active {
    transform: scale(0.95);
}

/* 结算界面样式 */
.time-used {
    font-size: 18px !important;
    font-weight: bold !important;
    color: #FF6B6B !important;
    margin: 10px 0 !important;
}

.alert-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.alert-btn.restart {
    background: #FF6B6B;
}

.alert-btn.restart:hover {
    background: #ee5a52;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.alert-btn.close {
    background: #6c757d;
}

.alert-btn.close:hover {
    background: #5a6268;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}