/* 数独游戏样式 */
.sudoku-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    gap: 1px;
    background-color: #333;
    padding: 3px;
    border-radius: 5px;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
}

.sudoku-cell {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: white;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    width: 100%;
    height: 100%;
    text-align: center;
    outline: none;
    transition: background-color 0.2s ease;
}

.sudoku-cell.fixed {
    background-color: #f0f0f0;
    color: #2c3e50;
    font-weight: bold;
}

.sudoku-cell.user-input {
    color: #3498db;
}

.sudoku-cell:hover {
    background-color: #e8f4f8;
}

.sudoku-cell:focus {
    background-color: #d5eaf2;
    box-shadow: inset 0 0 0 2px #3498db;
}

/* 3x3宫格边框 */
.sudoku-cell:nth-child(3n) {
    border-right: 2px solid #333;
}

.sudoku-cell:nth-child(9n) {
    border-right: none;
}

.sudoku-cell:nth-child(n+19):nth-child(-n+27),
.sudoku-cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid #333;
}

/* 数字输入面板 */
.number-pad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 400px;
}

.num-btn {
    padding: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.num-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.num-btn[data-num="clear"] {
    grid-column: span 2;
    background-color: #e74c3c;
}

.num-btn[data-num="clear"]:hover {
    background-color: #c0392b;
}

/* 数独游戏状态 */
#sudoku-status {
    font-weight: bold;
    color: #27ae60;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sudoku-grid {
        max-width: 350px;
    }
    
    .sudoku-cell {
        font-size: 1rem;
    }
    
    .number-pad {
        max-width: 350px;
    }
    
    .num-btn {
        padding: 12px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .sudoku-grid {
        max-width: 300px;
    }
    
    .sudoku-cell {
        font-size: 0.9rem;
    }
    
    .number-pad {
        max-width: 300px;
        gap: 8px;
    }
    
    .num-btn {
        padding: 10px;
        font-size: 0.9rem;
    }
}